yashsingh1/xdaforums huggingface dataset:
[Sony Cross-Device General] devilmaycry2020:
[MENTION=4315551]Ticklefish[/MENTION]

Video when charging to see what they look like. please.

Here is my code :

<LinearLayout android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginStart="4.0dip">
<LinearLayout android:id="@id/battery_meter" android:layout_width="wrap_content" android:layout_height="fill_parent">
<ImageView android:layout_gravity="center_vertical" android:id="@id/status" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<ImageView android:layout_gravity="center_vertical" android:id="@id/battery_icon" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<ImageView android:layout_gravity="center_vertical" android:id="@id/stamina_icon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/somc_sys_powersaver" />
</LinearLayout>
<FrameLayout android:id="@id/battery_percent" android:layout_width="wrap_content" android:layout_height="fill_parent">
<ImageView android:layout_gravity="start|center" android:id="@id/battery_percent_bg" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<TextView android:textSize="@dimen/battery_percent_text_size" android:textStyle="bold" android:gravity="center" android:layout_gravity="start|center" android:id="@id/battery_text" android:layout_width="@dimen/battery_percent_text_layout_width" android:layout_height="wrap_content" android:singleLine="true" android:layout_marginStart="@dimen/battery_percent_text_start_margin" />
</FrameLayout>
</LinearLayout>

i want the stamina icon around battery icon like this

If i move the line code for stamina icon inside /framelayout the stamina icon only display when i activated stamina mode,and the stamina icon overlap battery icon. look picture
[Sony Cross-Device General] DanielFlorin:
Any Xperia. It would be good to be with android 4.1, I saw for 4.1 not anything new and it is a pity because many still have 4.1. So can you make a tutorial?
[Sony Cross-Device General] Ticklefish:
Guys, check out Tickle My Android (tinyurl.com/ticklemyandroid). It has over 70 different battery icons available, including the Xperia KitKat battery icon, and can change the battery icon on any version of Android automatically. Including KitKat! (Once the right smali changes have been done, of course!)

This is a hobby, not my job. Saying that you expect me to do something is not likely to motivate me to do so.

I was after a screenshot of your current statusbar, so I could see what your battery icon is like. That would help me in tracking down how your rom generates the icon.

I'm guessing that CM11 generates the battery icon with code, not images, which will make this mod a lot trickier. But I'll take a look and see if I can come up with something. There's always a way! :D

Give the attached zip a try. Flash it in CWM, not TWRP.

I have taken a video of the charging icon changing...I'm just struggling with connection speeds so I can upload it to Youtube! Grrr...
[Sony Cross-Device General] Ticklefish:
The tutorial in the OP has just been updated...again! Hopefully the smali-editing part is easier to understand now.

Oh, and there's a video of the charging icon in action.. :cool:
[Sony Cross-Device General] devilmaycry2020:
thanks. remember my phone running 4.3 not 4.4.2, your file sent to me for 4.4, so i manually copy it but after reboot my phone got bootloop.
[Sony Cross-Device General] Ticklefish:
I remember..but your apk was from 4.4..and my zip was for any version of Android..
[Sony Cross-Device General] Huncriter:
sorry for that,google transaltor can sound so imperative sometimes... and yes cm11 generates battery icon with code
[Sony Cross-Device General] Ticklefish:
So these are the relevant codes from your status_bar.xml:

<com.android.systemui.BatteryMeterView android:id="@id/battery" android:layout_width="@dimen/status_bar_battery_width" android:layout_height="@dimen/status_bar_battery_height" android:layout_marginBottom="@dimen/status_bar_battery_bottom_padding" android:layout_marginStart="4.0dip" />
<com.android.systemui.DockBatteryMeterView android:id="@id/dock_battery" android:visibility="gone" android:layout_width="@dimen/status_bar_battery_width" android:layout_height="@dimen/status_bar_battery_height" android:layout_marginBottom="@dimen/status_bar_battery_bottom_padding" android:layout_marginStart="4.0dip" />

Yeah, your battery icon is made using code, not png images. I had a look at BatteryMeterView.smali and DockBatteryMeterView.smali and they're just beyond my current skills.

Have a look here: http://xdaforums.com/showthread.php?t=2628560

This is a guide for adding battery icons to a Samsung TouchWiz KK rom. It won't be quite the same for your rom but hopefully it can help you.

I don't honestly know why Cyanogenmod did this. They're a group of modders, surely they know how much modders like to change their icons?! Hopefully they'll see sense and fix it..

Hmmm...I guess you must have been posting that while I was writing my post. Weird...lol It's cool, don't worry about it. ;)
[Sony Cross-Device General] devilmaycry2020:
your file didn't work. i decompiled your file and saw some different in BatteryController.smali with my file and different in your guide
[Sony Cross-Device General] Ticklefish:
Hmm..I'll take another look. I don't think I properly realised that your entire SystemUI.apk is actually JB made to look like KK. I thought it was a KK apk made to work on JB..

Have you been able to change the battery icons on your own?
[Sony Cross-Device General] whalesplaho:
brov if i wanna have tha awesome battery mod; http://xdaforums.com/xperia-z/themes-apps/mod-remove-battery-icon-awesome-t2417364

do i need still follow OP guide?
[Sony Cross-Device General] Ticklefish:
If you're using 4.3, yes. I'd forgotten about that thread, I'll have to update it to say it's only for Jelly Bean.
[Sony Cross-Device General] whalesplaho:
but in yur screenshot here buddy, yhu using it..... http://i.imgur.com/1DV60kJ.png

ima using 4.4 Ported SystemUI.

i just want tha battery style in tha screenshot on my phone too.... :D
[Sony Cross-Device General] whalesplaho:
error while compiling after editing smali file too....

Log For : SystemUI.apk

Log Type : Recompiling

Log Recorded At : 06 2014-13- 21:33:23.20

Log Recorded By : Advanced ApkTool v2.0.0 By BDFreak

------------------------------------------------------

..\3-Out\SystemUI.apk\smali\com\android\systemui\statusbar\policy\BatteryController.smali[912,15] no viable alternative at input 'icon'
..\3-Out\SystemUI.apk\smali\com\android\systemui\statusbar\policy\BatteryController.smali[912,20] no viable alternative at input 'Landroid/widget/ImageView;'
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/android/systemui/statusbar/policy/BatteryController.smali
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:72)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:56)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:338)
at brut.androlib.Androlib.buildSources(Androlib.java:299)
at brut.androlib.Androlib.build(Androlib.java:285)
at brut.androlib.Androlib.build(Androlib.java:258)
at brut.apktool.Main.cmdBuild(Main.java:236)
at brut.apktool.Main.main(Main.java:88)

------------------------------------------------------

---------- Post added at 10:18 PM ---------- Previous post was at 09:38 PM ----------

Compiled successfully now.... but SystemUI FC!
[Sony Cross-Device General] Ticklefish:
Check all the various quoting of your posts I've done today. I mentioned a mod by Erhany...

Got a logcat?
[Sony Cross-Device General] whalesplaho:
moi bad, didnt have... maybe i ll still retry but change OP in tut smali tut, yhu repeated somc_sys_charging twice!
[Sony Cross-Device General] mohoram:
thanks for the reply. but not what I wanted. when you are charging the battery icon is behind (in the background) Animation battery charging icon.

Enviado desde mi C6603 mediante Tapatalk
[Sony Cross-Device General] Ticklefish:
It was...have you tried the updated tutorial?
[Sony Cross-Device General] devilmaycry2020:
i can change the battery icon on my own. but one problem left is stamina icon display not good(wrong position) as my previous post.
[Sony Cross-Device General] whalesplaho:
why not just make it transparent brov.... or what do yhu think?
[Sony Cross-Device General] whalesplaho:
tha status bar code in OP aint there no more.
[Sony Cross-Device General] devilmaycry2020:
Reading several my post mate, I want stamina icon display properly on both checked and unchecked battery level percentage , not hiding it, do you clear?
[Sony Cross-Device General] Ticklefish:
That's weird..oh well, it's back in there now!

Give this code a try, replacing your current signal_battery_cluster Layout:

<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="2.0dip">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
<FrameLayout android:layout_width="wrap_content" android:layout_height="fill_parent">
<ImageView android:layout_gravity="center" android:id="@id/stamina_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/somc_sys_powersaver" />
<LinearLayout android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginStart="4.0dip">
<ImageView android:layout_gravity="center_vertical" android:id="@id/status" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<LinearLayout android:id="@id/battery_meter" android:layout_width="wrap_content" android:layout_height="fill_parent">
<ImageView android:layout_gravity="center_vertical" android:id="@id/battery_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<FrameLayout android:id="@id/battery_percent" android:layout_width="wrap_content" android:layout_height="fill_parent">
<com.sonymobile.systemui.statusbar.BatteryImage android:layout_gravity="start|center" android:id="@id/battery_percent_bg" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</FrameLayout>
</LinearLayout>
</FrameLayout>
</LinearLayout>

I can't test it myself right now but, in theory, this should put the stamina icon behind the battery Layout. That way the icon should be behind the percentage..and the battery icon.
[Sony Cross-Device General] devilmaycry2020:
thanks for your help. but it didn't work,just got FC.
[Sony Cross-Device General] Ticklefish:
Strange...do you have a logcat?

What's your current, working status_bar.xml?
[Sony Cross-Device General] whalesplaho:
according to tha code in OP, it places tha charging icon will be placed besides tha battery icon, so i have dis... but since tha battery icon ima using is differs, i want tha battery & charging together!

<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="2.0dip">
<LinearLayout android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginStart="4.0dip">
<LinearLayout android:id="@id/battery_meter" android:layout_width="wrap_content" android:layout_height="fill_parent">
<ImageView android:layout_gravity="center_vertical" android:id="@id/status" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:layout_gravity="center_vertical" android:id="@id/battery_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<ImageView android:layout_gravity="center_vertical" android:id="@id/stamina_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/somc_sys_powersaver" />
</LinearLayout>
<FrameLayout android:id="@id/battery_percent" android:visibility="gone" android:layout_width="0.0dip" android:layout_height="0.0dip">
<ImageView android:layout_gravity="start|center" android:id="@id/battery_percent_bg" android:layout_width="wrap_content" android:layout_height="wrap_content" />
<TextView android:textSize="@dimen/battery_percent_text_size" android:textStyle="bold" android:gravity="center" android:layout_gravity="start|center" android:id="@id/battery_text" android:layout_width="@dimen/battery_percent_text_layout_width" android:layout_height="wrap_content" android:singleLine="true" android:layout_marginStart="@dimen/battery_percent_text_start_margin" />
</FrameLayout>
</LinearLayout>
[Sony Cross-Device General] Ticklefish:
Did you change your smali so that the battery icon doesn't show when your phone is plugged in?
[Sony Cross-Device General] whalesplaho:
was able to make something... i didnt do it brov since yhu said it ll make tha battery charging icon vanish!!! i wont have a charging animation when charging!!! now i change tha charging animation png.
[Sony Cross-Device General] Ticklefish:
It really depends on what you want to do with your icons.

Before KitKat the battery icon would be controlled by stat_sys_battery.xml while it was discharging and stat_sys_battery_anim_charge.xml while it was charging.

In KitKat, you now have two completely different icons. So if your new charging icon looks just like the ordinary battery icon but with a lightning bolt (or similar) you won't want to see the charging icon and the battery icon at the same time. So you'd need to do that smali mod and xml mod.

If you're happy with seeing the charging icon and battery icon together, then don't worry about it.
[Sony Cross-Device General] whalesplaho:
woah... thanks a mill brov!!! [MENTION=4315551]Ticklefish[/MENTION]

just too awesome now. added tha smali mod too!
[Sony Cross-Device General] Marília de Oliveira:
Help me

Well I installed a font more it bugou the symbol of percentage rather than getting the icon percentage>% after I installed the font the icon was just as pictured

how can I fix this?
[Sony Cross-Device General] jaxzr55:
@ Ticklefish read the tutorial but I need your help to finish my mod

I want to know what files to edit to delete the symbol% of the icon so just stay the number

I attached a picture please I hope you can help me and thanks

sorry for my bad English
[Sony Cross-Device General] Ticklefish:
Sounds like an issue with the font, to be honest.

I'll have a look for you and let you know.
[Sony Cross-Device General] gringoow:
Can anybody change this apk's battery icons with original Sony? Device: Arc/S

Link: http://d-h.st/E17

Thanks.
[Sony Cross-Device General] Ticklefish:
Not without your framework-res.apk, no.

What rom did this come from? And what version of Android?
[Sony Cross-Device General] gringoow:
Oh, i'm sorry. I uses KitKat 4.4.4 cm-11-20140817. Uploaded framewrok & systemui together. Thanks.

Link: http://d-h.st/5X3
[Sony Cross-Device General] WhiteNeo:
+1, I'd also be very curious how replacing the AOSP KK battery icon works. :)
[Sony Cross-Device General] Ticklefish:
Ah, CM. This mod is for stock Xperia KitKat. I'll take a look but it might be a lot harder....

Share your files and I'll have a look. :)
[Sony Cross-Device General] WhiteNeo:
Here are the files you need. :)

http://d-h.st/nSf

Thanks for being the first to care at all about a mod like this. Been looking all over the forums for a solution.. without success. But if anyone can do this, its you. :good:

Good luck! :)
[Sony Cross-Device General] gringoow:
I'll follow, thank you. [MENTION=4315551]Ticklefish[/MENTION]
[Sony Cross-Device General] Ticklefish:
Can you link to the rom you're using please?
[Sony Cross-Device General] WhiteNeo:
I can't, cause I compiled it myself. :)

It's pure OmniRom with some compiler flag optimizations. :good:
[Sony Cross-Device General] Ticklefish:
Fair enough. lol

I'm trying something now...watch this space!
[Sony Cross-Device General] Ticklefish:
Okay...so that didn't work. Is there a 4.3 version of your rom? I'm hoping there is because it looks like we need to borrow some of the files from it...
[Sony Cross-Device General] WhiteNeo:
Nope, no Omni 4.3 for my device.

But if you only need the BatteryMeterView files, wouldn't Omni for another xhdpi device do? :)

In case it does, here's a link to OmniRom 4.3 in Nexus 4 forums: http://xdaforums.com/nexus-4/development/rom-kernel-omnirom-5-26nov2013-t2484600
[Sony Cross-Device General] Ticklefish:
Give the attached zip a try and let me know what happens. In theory, your battery icon should now be changeable.

If it works, I'll make a tutorial showing people what to do.

If it doesn't, are you able to take a logcat?
[Sony Cross-Device General] WhiteNeo:
SystemUI fc.. But I didnt install your mod on a clean rom, so it might be caused by the omnirom battery icon settings (I had selected "Hide battery icon" there).. Would be great if the imaged battery replaces only the battery bar icon and doesnt break other icon settings like circle battery etc. :)

But I guess that's exactly what you are trying :D

Anyway, here's a log of the fc.

E/AndroidRuntime( 3002): FATAL EXCEPTION: main
E/AndroidRuntime( 3002): Process: com.android.systemui, PID: 3002
E/AndroidRuntime( 3002): java.lang.NoClassDefFoundError: com.android.systemui.statusbar.policy.BatteryController$SettingsObserver
E/AndroidRuntime( 3002): at com.android.systemui.statusbar.policy.BatteryController.(BatteryController.java:100)
E/AndroidRuntime( 3002): at com.android.systemui.statusbar.phone.PhoneStatusBar.makeStatusBarView(PhoneStatusBar.java:758)
E/AndroidRuntime( 3002): at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method)
E/AndroidRuntime( 3002): at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:631)
E/AndroidRuntime( 3002): at com.android.systemui.statusbar.phone.PhoneStatusBar.makeStatusBarView(Native Method)
E/AndroidRuntime( 3002): at com.android.systemui.statusbar.phone.PhoneStatusBar.addStatusBarWindow(PhoneStatusBar.java:2793)
E/AndroidRuntime( 3002): at com.android.systemui.statusbar.phone.PhoneStatusBar.createAndAddWindows(PhoneStatusBar.java:2767)
E/AndroidRuntime( 3002): at com.android.systemui.statusbar.BaseStatusBar.start(BaseStatusBar.java:309)
E/AndroidRuntime( 3002): at com.android.systemui.statusbar.phone.PhoneStatusBar.start(PhoneStatusBar.java:542)
E/AndroidRuntime( 3002): at com.android.systemui.statusbar.SystemBars.createStatusBarFromConfig(SystemBars.java:106)
E/AndroidRuntime( 3002): at com.android.systemui.statusbar.SystemBars.onNoService(SystemBars.java:58)
E/AndroidRuntime( 3002): at com.android.systemui.statusbar.ServiceMonitor.startService(ServiceMonitor.java:228)
E/AndroidRuntime( 3002): at com.android.systemui.statusbar.ServiceMonitor.access$000(ServiceMonitor.java:49)
E/AndroidRuntime( 3002): at com.android.systemui.statusbar.ServiceMonitor$1.handleMessage(ServiceMonitor.java:73)
E/AndroidRuntime( 3002): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 3002): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 3002): at android.app.ActivityThread.main(ActivityThread.java:5001)
E/AndroidRuntime( 3002): at java.lang.reflect.Method.invokeNative(NativeMethod)
E/AndroidRuntime( 3002): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 3002): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
E/AndroidRuntime( 3002): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
E/AndroidRuntime( 3002): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
E/AndroidRuntime( 3002): at dalvik.system.NativeStart.main(Native Method)

W/ActivityManager( 929): Process com.android.systemui has crashed too many time
s: killing!
[Sony Cross-Device General] Ticklefish:
That's the plan...

Hmm..according to that logcat, I think I need to copy over another smali file from 4.3. to get this to work.

I'm away from computer for the next two days so I can't try it out but I'll get back to this as soon as I can.
[Sony Cross-Device General] STRYDER~007:
Guys...Need Help Please....

Hey guys...I need help...I was trying to port the battery icon from stock sony kitkat to my SystemUI...I'm using Xperia L Jelly Bean 4.2.2...I copied drawable files from kitkat SystemUI to my UI...Also Copied pngs.. Stored all related reference values to ids,integer,string etc...I Also added Batterymeter,Battery Image,Battery Controller smali files to my SystemUI...Changed the address references in smali files according to my public.xml And recompiled SystemUI successfully..But still,my SystemUI is not working...It doesn't give force close but it isn't running as well....What am I doing wrong??Please someone help me....:crying::(
[Sony Cross-Device General] Ticklefish:
If all you want is a battery icon that looks like the Xperia KitKat one, you just need to change your png's and xml.

My theming tool, Tickle My Android, can do this for you.

Or just extract the files from here: http://www.mediafire.com/view/g132l6xnpa1v9ir
[Sony Cross-Device General] WhiteNeo:
Thanks for your efforts. :)

I am sure we can make this. :good:

Are you talking about the BatteryController$SettingsObserver.smali that has to be copied from 4.3? If yes, I might give it a shot myself :good:
[Sony Cross-Device General] STRYDER~007:
Hey buddy... I've tried the kitkat battery using Trickle my Android and it's awesome! But what I want now is stock like battery icon... Percentage inside battery.. And also stamina mode shown on battery icon.. That's what I'm trying to do but it isn't happening.. I want to find out where I'm doing wrong.. So please can you help me with this?? :confused:
[Sony Cross-Device General] Ticklefish:
That's the one! From what I remember of that smali, you shouldn't have to change any references..just copy it over from one apk to the other.