[Sony Cross-Device Development Themes and Apps] venkat kamesh:
Systemui ( First part )

1. Decompile SystemUI.apk

2. Download this Attchment View attachment 3785916 and merge

open systemui.apk/res/arrays.xml

before </resources> add this

<integer-array name="batterymeter_color_levels_1">
<item>4</item>
<item>15</item>
<item>100</item>
</integer-array>
<array name="batterymeter_color_values_1">
<item>#ffff3300</item>
<item>#ffff3300</item>
<item>#ffffffff</item>
</array>
<integer-array name="batterymeter_inverted_bolt_points">
<item>743</item>
<item>73</item>
<item>743</item>
<item>292</item>
<item>442</item>
<item>201</item>
<item>442</item>
<item>400</item>
<item>0</item>
<item>20</item>
<item>369</item>
<item>157</item>
<item>369</item>
<item>0</item>
</integer-array>

open systemui.apk/res/attrs.xml

before </resources> add this

<attr name="batteryView" format="string" />

open systemui.apk/res/colors.xml

before </resources> add this

<color name="batterymeter_critical">#ffff3300</color>
<color name="batterymeter_low">#ffff3300</color>
<color name="batterymeter_full">#ffffffff</color>
<color name="battery_text_color">#ffffffff</color>
<color name="statusbar_clock_color">#ffffffff</color>

open systemui.apk/res/styles.xmlbefore </resources> add this

<style name="TextAppearance.StatusBar.Battery" parent="@android:style/TextAppearance.StatusBar.Icon">
<item name="android:textSize">13.0dip</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">@color/status_bar_clock_color</item>
</style>

now compile and decompile for public ids

Now open com/android/systemui/statusbar/phone/phonestatusbar.smali

find this

Lcom/android/systemui/statusbar/phone/PhoneStatusBar$H;

before that add this line

Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatterySettingsObserver;,

now look for this

.field private mBackdropInterpolator:Landroid/view/animation/Interpolator;

below that add these lines

.field private mBattery:Lcom/android/systemui/BatteryMeterViewMod;

.field private mCircleBattery:Lcom/android/systemui/BatteryCircleMeterView;

find this access code

.method static synthetic access$7800(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)Landroid/widget/ImageView;

access$7800 may differ so dont worry

above that add this

.method static synthetic access$77000(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
.locals 0
.param p0, "x0" # Lcom/android/systemui/statusbar/phone/PhoneStatusBar;

.prologue
.line 155
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateBatteryIcons()V

return-void
.end method

now look for this method

.method private updateClearAll()V

above that add this method

.method private updateBatteryIcons()V
.locals 2

.prologue
const/4 v1, 0x0

.line 723
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBattery:Lcom/android/systemui/BatteryMeterViewMod;

if-eqz v0, :cond_0

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCircleBattery:Lcom/android/systemui/BatteryCircleMeterView;

if-eqz v0, :cond_0

.line 724
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBattery:Lcom/android/systemui/BatteryMeterViewMod;

invoke-virtual {v0, v1}, Lcom/android/systemui/BatteryMeterViewMod;->updateSettings(Z)V

.line 725
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCircleBattery:Lcom/android/systemui/BatteryCircleMeterView;

invoke-virtual {v0, v1}, Lcom/android/systemui/BatteryCircleMeterView;->updateSettings(Z)V

.line 727
:cond_0
return-void
.end method

now look for this method

.method protected makeStatusBarView()Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

in that method

look for this line

invoke-virtual {v0, v3, v1}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

below that line add this code

move-object/from16 v0, p0

iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

const v2, 0x7f10021d

invoke-virtual {v1, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;

move-result-object v1

check-cast v1, Lcom/android/systemui/BatteryMeterViewMod;

move-object/from16 v0, p0

iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBattery:Lcom/android/systemui/BatteryMeterViewMod;

iget-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

const v2, 0x7f10021c

invoke-virtual {v1, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;

move-result-object v1

check-cast v1, Lcom/android/systemui/BatteryCircleMeterView;

move-object/from16 v0, p0

iput-object v1, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCircleBattery:Lcom/android/systemui/BatteryCircleMeterView;

invoke-direct/range {p0 .. p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateBatteryIcons()V

change the ids compare with mine and replace with yours

now look for this method

.method public start()V

in that find this line

new-instance v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;

above that line add this

new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatterySettingsObserver;

iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHandler:Lcom/android/systemui/statusbar/BaseStatusBar$H;

invoke-direct {v0, p0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatterySettingsObserver;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/os/Handler;)V

invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatterySettingsObserver;->observe()V

save it and close

3. Now open com/android/systemui/R$styleable.smali

look for this

.field public static final AnalogClock:[I

below that add this

.field public static final BatteryIcon:[I

now look for this

sput-object v0, Lcom/android/systemui/R$styleable;->AnalogClock:[I

below add this

new-array v0, v3, [I

const v1, 0x7f01003c

aput v1, v0, v2

sput-object v0, Lcom/android/systemui/R$styleable;->BatteryIcon:[I

compare id from mine and replace

save it and close

compare my public ids and replace with your ids

from these files

com/android/systemui/BatteryCircleMeterView

com/android/systemui/BatteryMeterView

com/android/systemui/BatteryMeterView$BatteryTracker

and you are finally done :p

save it all and compile and replace