Any way to make battery icon image update every 10% rather than every 20%?

microsnook

Active Member
Joined
Feb 8, 2010
Messages
1,291
Reaction score
0
Thanks for the heads up about the themed rom. I totally forgot that and I should have remembered that

Update -- OK great Ive managed to get the Apk Manager up and running in winxp. Just need the whole adb, aosp thing installed, and apk manager as pre-requisites. Ive done a couple of test builds using the stock framework-res.apk (very important!!!), and modified eri.xml by decompiling and then recompiling, and then taking the newly compiled xml and dropping it into winrar to add to the stock framework. I didnt try the sign and install method. Now that the test runs are successful hopefully I can get cracking on this battery (and maybe from help from Chevy).

Ugh, how I wish I could contribute!
Keep it up kev
 

kevdog

Member
Joined
Nov 14, 2009
Messages
721
Reaction score
0
Ok -- just some ideas

I'm realizing that although I understand in general the concept of xml files, when it would come to creating an entry -- I'm really clueless. Wow a good tutorial would help (but how do I hate eclipse)!

Anyway just wondering what others have found along with questions:

Two xml files and one image directory jump out on review of the data:

/res/drawable/stat_sys_battery.xml:
<item android:drawable="@drawable/stat_sys_battery_0" android:maxLevel="4" />
<item android:drawable="@drawable/stat_sys_battery_10" android:maxLevel="14" />
<item android:drawable="@drawable/stat_sys_battery_20" android:maxLevel="29" />
<item android:drawable="@drawable/stat_sys_battery_40" android:maxLevel="49" />
<item android:drawable="@drawable/stat_sys_battery_60" android:maxLevel="69" />
<item android:drawable="@drawable/stat_sys_battery_80" android:maxLevel="89" />
<item android:drawable="@drawable/stat_sys_battery_100" android:maxLevel="100" />
/res/values/public.xml:
<public type="drawable" name="stat_sys_battery_0" id="0x01080293" />
<public type="drawable" name="stat_sys_battery_10" id="0x01080294" />
<public type="drawable" name="stat_sys_battery_100" id="0x01080295" />
<public type="drawable" name="stat_sys_battery_20" id="0x01080296" />
<public type="drawable" name="stat_sys_battery_40" id="0x01080297" />
<public type="drawable" name="stat_sys_battery_60" id="0x01080298" />
<public type="drawable" name="stat_sys_battery_80" id="0x01080299" />

And of course the /res/drawable-hdpi-v4 folder where the images are located.

Although /res/layout/battery_status.xml refers to the battery layout style I dont think this file is relevant although I don't quite fully understand this file unless its the text that is overlayed over the battery -- Not sure about this one.

Ok the big question -- when declaring new images -- am I ok with just arbitrarily picking IDs? A suggestion was to make them consecutive to the last drawable ID values, however if I look at the last 3 ID drawable values they seem not to be consecutive (these are found in res/values/public.xml):
<public type="drawable" name="usb_android_connected" id="0x01080358" />
<public type="drawable" name="bottombar_565" id="0x010800af" />
<public type="drawable" name="btn_lock_normal" id="0x010800fd" />

Thanks for any input!!!
 

Coolsaber57

Member
Joined
Jan 7, 2010
Messages
345
Reaction score
0
Ok -- just some ideas

I'm realizing that although I understand in general the concept of xml files, when it would come to creating an entry -- I'm really clueless. Wow a good tutorial would help (but how do I hate eclipse)!

Anyway just wondering what others have found along with questions:

Two xml files and one image directory jump out on review of the data:

/res/drawable/stat_sys_battery.xml:
<item android:drawable="@drawable/stat_sys_battery_0" android:maxLevel="4" />
<item android:drawable="@drawable/stat_sys_battery_10" android:maxLevel="14" />
<item android:drawable="@drawable/stat_sys_battery_20" android:maxLevel="29" />
<item android:drawable="@drawable/stat_sys_battery_40" android:maxLevel="49" />
<item android:drawable="@drawable/stat_sys_battery_60" android:maxLevel="69" />
<item android:drawable="@drawable/stat_sys_battery_80" android:maxLevel="89" />
<item android:drawable="@drawable/stat_sys_battery_100" android:maxLevel="100" />
/res/values/public.xml:
<public type="drawable" name="stat_sys_battery_0" id="0x01080293" />
<public type="drawable" name="stat_sys_battery_10" id="0x01080294" />
<public type="drawable" name="stat_sys_battery_100" id="0x01080295" />
<public type="drawable" name="stat_sys_battery_20" id="0x01080296" />
<public type="drawable" name="stat_sys_battery_40" id="0x01080297" />
<public type="drawable" name="stat_sys_battery_60" id="0x01080298" />
<public type="drawable" name="stat_sys_battery_80" id="0x01080299" />

And of course the /res/drawable-hdpi-v4 folder where the images are located.

Although /res/layout/battery_status.xml refers to the battery layout style I dont think this file is relevant although I don't quite fully understand this file unless its the text that is overlayed over the battery -- Not sure about this one.

Ok the big question -- when declaring new images -- am I ok with just arbitrarily picking IDs? A suggestion was to make them consecutive to the last drawable ID values, however if I look at the last 3 ID drawable values they seem not to be consecutive (these are found in res/values/public.xml):
<public type="drawable" name="usb_android_connected" id="0x01080358" />
<public type="drawable" name="bottombar_565" id="0x010800af" />
<public type="drawable" name="btn_lock_normal" id="0x010800fd" />

Thanks for any input!!!

Don't forget the stat_sys_battery_charge.xml as well, if you want to update those to 10% increments as well.

For the stat_sys_battery.xml:
Basically it will display the PNG file until the battery hits the "max Level" so you need to add a few more entries. You can use Notepad++ as your XML editor. It's simple, free, and easy to use.

So the first ones are:
<item android:drawable="@drawable/stat_sys_battery_0" android:maxLevel="4" />
<item android:drawable="@drawable/stat_sys_battery_10" android:maxLevel="14" />
<item android:drawable="@drawable/stat_sys_battery_20" android:maxLevel="29" />

Then you need to add in a line for the 30th increment:

<item android:drawable="@drawable/stat_sys_battery_30" android:maxLevel="39" />

And so on for the rest of the new increments.

As for the Public.xml (at least from what I've tried to google/figure out from playing with it):
They are not necessarily sequential going down the list. However, you can look to the bottom of the Drawables and find the last number, then hit ctrl-f, copy in that last number + 1 and see if it shows up. If it finds it, it will show you that number and you can trace it to the largest one. Do that repeatedly until you can't find that ID anymore.

Important note: The numbers are in Hexadecimal. I'm not sure what your level of knowledge is in this area, but if you're not familiar, the numbers go:
1,2,3,4,5,6,7,8,9,a,b,c,d,e,f
10,11,12,13,14,15,16,17,18,19,1a,1b,1c,1d,1e,1f
etc.

Oh, and I don't think you need to mess with the layout .xml file. Not completely sure about it, but it doesn't seem to reference any specific PNG files.
 
Last edited:

kevdog

Member
Joined
Nov 14, 2009
Messages
721
Reaction score
0
Yea -- I'm using Notepad++ -- I find it awesome.

This isn't as hard to do as I thought once I've looked at all the files for about the last hour -- of course I haven't produced a working product yet either. If someone could provide me some .png files for the battery percentages, I would be happy to try -- I guess I could mock my own up (I used to do this), however I'm not much of a graphic artist, and frankly gimping or photoshopping doesn't excite me a whole ton. I guess its not my thing.

Lastly -- Im out for the weekend -- so peace. I'll pick this back up on Monday. Thanks guys
 

microsnook

Active Member
Joined
Feb 8, 2010
Messages
1,291
Reaction score
0
Yea -- I'm using Notepad++ -- I find it awesome.

This isn't as hard to do as I thought once I've looked at all the files for about the last hour -- of course I haven't produced a working product yet either. If someone could provide me some .png files for the battery percentages, I would be happy to try -- I guess I could mock my own up (I used to do this), however I'm not much of a graphic artist, and frankly gimping or photoshopping doesn't excite me a whole ton. I guess its not my thing.

Lastly -- Im out for the weekend -- so peace. I'll pick this back up on Monday. Thanks guys

Here are the icons!
Hope it works out
 

Coolsaber57

Member
Joined
Jan 7, 2010
Messages
345
Reaction score
0
Yea -- I'm using Notepad++ -- I find it awesome.

This isn't as hard to do as I thought once I've looked at all the files for about the last hour -- of course I haven't produced a working product yet either. If someone could provide me some .png files for the battery percentages, I would be happy to try -- I guess I could mock my own up (I used to do this), however I'm not much of a graphic artist, and frankly gimping or photoshopping doesn't excite me a whole ton. I guess its not my thing.

Lastly -- Im out for the weekend -- so peace. I'll pick this back up on Monday. Thanks guys

No problem. Oh and you can just grab the PNG files from any Chevy theme.
 

kevdog

Member
Joined
Nov 14, 2009
Messages
721
Reaction score
0
I'm gone fort weekend but will be back to this on monday. Thanks for your enthusiasm
 

kevdog

Member
Joined
Nov 14, 2009
Messages
721
Reaction score
0
I was attempting to ask Chevy a question about a few things but he never got back to me
 
Top