Personalizzare Icona Batteria
Ora è possibile farlo!
Sono riuscito ad inserire OGBattery by OsamaGhareeb
FONTE:
http://forum.xda-developers.com/show....php?t=2730108
Ho tradotto in italiano OGBattery.
DOWNLOAD:
https://mega.co.nz/#!RZQnlIxA!esRGQq...6GrKPZ7O3h4mWU
SecSettings
res/xml/display_settings.xml
codice:
<PreferenceScreen android:title="@string/battery_mod" android:key="OGBattery" android:summary="@string/battery_mod_desc">
<intent android:targetPackage="com.ghareeb.battery" android:action="android.intent.action.MAIN" android:targetClass="com.ghareeb.battery.Settings" />
</PreferenceScreen>
res/values/ids.xml
codice:
<item type="id" name="OGBattery">false</item>
res/values/strings.xml
codice:
<string name="battery_mod">OGBattery Mod</string>
<string name="battery_mod_desc">Change battery icon and charging animation.</string>
res/values-it/strings.xml
codice:
<string name="battery_mod">Icona Batteria</string>
<string name="battery_mod_desc">Personalizza l\'icona Batteria e la relativa animazione, nella barra di stato.</string>
SystemUI
smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali
codice:
.field mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
sostituito con
codice:
.field mBatteryController:Lcom/ghareeb/BatteryMod/BatteryController;
codice:
invoke-direct/range {v29 .. v30}, Lcom/android/systemui/statusbar/policy/BatteryController;-><init>(Landroid/content/Context;)V
sostituito con
codice:
invoke-direct/range {v29 .. v30}, Lcom/ghareeb/BatteryMod/BatteryController;-><init>(Landroid/content/Context;)V
codice:
.line 885 new-instance v29, Lcom/ghareeb/BatteryMod/BatteryController;
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
move-object/from16 v30, v0
invoke-direct/range {v29 .. v30}, Lcom/ghareeb/BatteryMod/BatteryController;-><init>(Landroid/content/Context;)V
move-object/from16 v0, v29
move-object/from16 v1, p0
iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/ghareeb/BatteryMod/BatteryController;
codice:
.line 886 move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/ghareeb/BatteryMod/BatteryController;
move-object/from16 v27, v0
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
move-object/from16 v26, v0
const v28, 0x7f0800da
move-object/from16 v0, v26
move/from16 v1, v28
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v26
check-cast v26, Landroid/widget/ImageView;
move-object/from16 v0, v27
move-object/from16 v1, v26
invoke-virtual {v0, v1}, Lcom/ghareeb/BatteryMod/BatteryController;->addIconView(Landroid/widget/ImageView;)V
codice:
.line 887 move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/ghareeb/BatteryMod/BatteryController;
move-object/from16 v26, v0
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryText:Landroid/widget/TextView;
move-object/from16 v27, v0
invoke-virtual/range {v26 .. v27}, Lcom/ghareeb/BatteryMod/BatteryController;->addLabelView(Landroid/widget/TextView;)V
res/layout/status_bar.xml
codice:
<ImageView android:gravity="center" android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingStart="3.0dip" />