# XML for battery %



## lu270bro (Jun 9, 2011)

I have a question. I would like to know which xml in a TMob theme engine apk controls the battery reporting percentages. I have decompiled templatebread and found "android xml" within the "master" xml folder (which is inside the "res" folder) and its only showing in the normal 20% increments. I decompiled another theme that does report in 1% increments and same thing... in the "android xml" it shows 20%. WTF? Am I looking in the wrong place? I cannot seem to find the correct xml and this is one of the last things I need to do before being able to complete my first theme and I have autosigning, draw9patch with xultimate, etc set up and tested perfectly. Im pulling my hair out! I have been searching the internet for 2 days now and cant find anything that nails it down. Thanks so much for any responses!


----------



## lu270bro (Jun 9, 2011)

So, no takers yet? Been a couple days and I figured a reply would have been made. The surely it's not as simple as adding in the increments in xml and then the corresponding pngs, right?

Thunderbolt..... RootzWiki.... blah blah blah


----------



## JsinLegacy (Jun 7, 2011)

which xml ... just to change the actual battery to 1% increments or editing the text based battery with the right side bar?


----------



## lu270bro (Jun 9, 2011)

Thanks for the reply. its the battery percentage in the status bar in between the signal and clock.

Thunderbolt..... RootzWiki.... blah blah blah


----------



## JsinLegacy (Jun 7, 2011)

haha... I know.. but is the the actual battery image... or the text based battery ... ?

either way I am going to assume you mean the actual battery and you want to avoid in increasing in 5, 10 or 20 percent increments... also I will assume you are wanting it to increase in single digit increments.. basically 1-100... (of course I could just be reading your initial question wrong) .. anyways .. lets move on shall we...

What you need to do is go into framework-res of CM7 and find stat_sys_battery.xml, which I believe is in the drawable folder,.. then you need to add your edits in there...you should see how they are done with the numbers already present.. just copy and paste.. make sure to replace the number and place them in correct order.. save that file.. place it into the drawable folder (inside your theme.apk) in the theme engine.. then you are going to basically tell the theme and CM7 that you want those battery images displayed over the standard/stock ones.. so you need to open up the android.xml, which should be in the XML folder.. and create a line that calls to the xml you just edited and placed in the drawable folder... you should be able to see how the other lines are done, that will tell you how to write your line to call to the edited xml ..

as for the percentage the color code is controlled in Systemui.apk .. I believe the status_bar.xml (not sure off the top of my head) .. as for the bar to the right of it .. that appears to be whatever your standard battery is only compressed... if you edit it that you will also have to create a line in the com_android_systemui.xml inside the XML folder... its done the same way as above..


----------



## lu270bro (Jun 9, 2011)

You are the shiz! Thats what i needed. I just couldn't find it in the theme.apk. I really appreciate you helping.

Thunderbolt..... RootzWiki.... blah blah blah


----------

