1. You want that $100.00 in your pocket or an Amazon Fire TV don't you? Well here's the deal. With our new updated look we are in desperate need of an updated logo. The 'old' one has certainly served us well, but it's time. Find all the details here: bit.ly/1q0k6Wa
  2. DroidForums.net is currently undergoing a major software upgrade. If you are experiencing any problems logging in please: Contact Us

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

Discussion in 'cvpcs' started by Vanilla Tarantino, Aug 6, 2010.

  1. Vanilla Tarantino
    Offline

    Vanilla Tarantino New Member

    Joined:
    Nov 12, 2009
    Messages:
    135
    Likes Received:
    0
    Trophy Points:
    0
    I've been playing around with theming and decided to change my battery icon. I switched to a circular battery icon and was hoping to know battery percentages left just based on appearance (without having the percentage displayed in the battery). The problem with this is that battery images are only updated every 20%. Obviously the system can detect 10% changes since when you choose to have battery percentage displayed, it update every 10%. Is there any relatively easy way to make the image update every 10% decrease in battery, or is that something that would need to be done by cvpcs were he to deem it a useful feature?

    Although I doubt it is, just in case this setting can be theme dependent, I'm running black bar mod.
  2. cobra2
    Offline

    cobra2 New Member

    Joined:
    Aug 2, 2010
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    0
    I've not noticed my battery updating in anything greater that 10% increments, it updates in 5% increments when it's less than 20% battery life. I'm wondering if it's possible that your not looking at your phone often enough to notice the decrease.
  3. Vanilla Tarantino
    Offline

    Vanilla Tarantino New Member

    Joined:
    Nov 12, 2009
    Messages:
    135
    Likes Received:
    0
    Trophy Points:
    0
    The number that appears "in" the icon will update every 10%, so it may appear that it's updating that frequently, but the image for the battery icon will only update every 20%. The number that displays is just drawn over the image. I'm hoping to get the image itself to update every 10%.
  4. cobra2
    Offline

    cobra2 New Member

    Joined:
    Aug 2, 2010
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    0
    Ahh, well that would just be messing with the icon images itself. I'm not a theme guy myself. [LOL, I'm a nobody, I don't do anything.] I'd assume that the only thing that would be needed would be to add in more images to the battery icon set.
  5. carlz28
    Offline

    carlz28 Premium Member Theme Developer Premium Member

    Joined:
    Feb 28, 2010
    Messages:
    820
    Likes Received:
    1
    Trophy Points:
    0
    If I understand correctly, basically what you want is to have a total of 10-12 icons for the battery state? Like 5%, 10%, 20%, 30%, 40%, 50%..........90%, 100% icons?
    Creating the icons would be very simple.
    But I think cvpcs would have to chime in on this one to see if the phone itself (in the code) actually would/could call for an image when it's reporting the odd percentages.
    Like you mentioned....theres an icon for 5,10,20,40,60,80,100%'s and they show up when the system reports those levels of battery.
    But if you create an icon for 30,50,70,90%'s...will those images show up when the system reports those levels.

    Hmmm..good question!
  6. serveitup911
    Offline

    serveitup911 New Member

    Joined:
    Dec 19, 2009
    Messages:
    291
    Likes Received:
    0
    Trophy Points:
    0
    I think this would be a nice feature! Vanilla, have you put in a feature request to bugzilla?
  7. Tallica
    Offline

    Tallica Premium Member Premium Member

    Joined:
    Mar 17, 2010
    Messages:
    3,259
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    Middleboro, MA
    U can't just add in the images it's hardcoded. But what are you guys talking about? On Sapphire 1.0 I get 90,70,50,30, as well as 80,60,40,20,10,5.
  8. sniffle
    Offline

    sniffle Premium Member Premium Member Developer

    Joined:
    Apr 6, 2010
    Messages:
    291
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Birmingham AL
    you have to add .png's to the correct folder and edit a .xml to reflect those file additions so that the phone will actually use them.

    i am at work and don't have time atm to give better details than this sorry
  9. carlz28
    Offline

    carlz28 Premium Member Theme Developer Premium Member

    Joined:
    Feb 28, 2010
    Messages:
    820
    Likes Received:
    1
    Trophy Points:
    0
    You're right and wrong. You can add images for the odd percentages. But like you and sniffle said, an xml edit would need to be made to reflect those images as options. As far as you having 90,70,50,30....there are currently no icons for those %'s in framework-res/res/drawable-hdpi. (at least to my knowledge) What you are seeing is the # overlay on top of the battery icons at the respective states. So when you're at 90%..its probably showing the 80% icon

    They would be put in framework-res/res/drawable-hdpi, like the others, right?
  10. Vanilla Tarantino
    Offline

    Vanilla Tarantino New Member

    Joined:
    Nov 12, 2009
    Messages:
    135
    Likes Received:
    0
    Trophy Points:
    0
    Adding the .png files was actually the first thing I tried...so they're currently sitting where they need to (which is how I discovered that it only updates the icon every 20%). Do you know what .xml file I would need to modify? I have no clue what I'm doing, but I'm always up for learning/figuring it out. dancedroid
  11. chevycam94
    Offline

    chevycam94 Steel Droid ROM Developer Developer

    Joined:
    May 12, 2010
    Messages:
    1,361
    Likes Received:
    12
    Trophy Points:
    38
    Location:
    Central Ohio
    Im going to search through the XMLs and see if I can find the file we are looking for. Its one addition I want to add to my custom ROM. <-- Soon-to-be DEV! (I hope)
  12. microsnook
    Offline

    microsnook New Member

    Joined:
    Feb 8, 2010
    Messages:
    1,291
    Likes Received:
    0
    Trophy Points:
    0
    This would be pretty cool to learn!
  13. iamlost87
    Offline

    iamlost87 New Member

    Joined:
    Apr 5, 2010
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    0
    The "correct folder" is the easy part... now to find which xml to edit. Any extra tidbits sniffles? I'd like to know which file and I'd love to get this up and running. I'd also be willing to create an update.zip and push this out there for others who would be interested as well. Just need to know which xml we're dealing with.
  14. microsnook
    Offline

    microsnook New Member

    Joined:
    Feb 8, 2010
    Messages:
    1,291
    Likes Received:
    0
    Trophy Points:
    0
    I hope this gets up and running, it would definitely be nice.

    Help us out devs! lol
  15. iamlost87
    Offline

    iamlost87 New Member

    Joined:
    Apr 5, 2010
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    0
    I found it.

    framework-res.apk>res>drawable>stat_sys_battery.xml

    decompile using apktool, re-write to use new images, compile it back up, and make it an update. If no one else wants to, I will do this tomorrow after work for a stock theme. From there, everyone can just edit the images.

    For now, I have to get some sleep before work.
  16. iamlost87
    Offline

    iamlost87 New Member

    Joined:
    Apr 5, 2010
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    0
    I did the work. I didnt edit the icons for now, so whoever uses this, feel free to open it up in 7z and edit the pictures before you flash it.

    Also, I'm on BB right now, and I didn't bother flashing over to Sapphire to test this. I'm pretty sure it will work, but as usual, make a back up before you flash.

    http://www.megaupload.com/?d=WN0VSGFM
    Last edited: Aug 11, 2010
  17. microsnook
    Offline

    microsnook New Member

    Joined:
    Feb 8, 2010
    Messages:
    1,291
    Likes Received:
    0
    Trophy Points:
    0
    Awesome!

    You need to teach me how to edit that xml!

    Ill download it and take a look lol
    Thanks : )
  18. microsnook
    Offline

    microsnook New Member

    Joined:
    Feb 8, 2010
    Messages:
    1,291
    Likes Received:
    0
    Trophy Points:
    0
    I cant get it to work.
    I pulled the xml file from the file you posted, and put it in my drawable folder, and then I went ahead and made all the battery images, pushed the framework, and no battery icons are being displayed.

    Not sure whats wrong
  19. microsnook
    Offline

    microsnook New Member

    Joined:
    Feb 8, 2010
    Messages:
    1,291
    Likes Received:
    0
    Trophy Points:
    0
    Anyone want to help out on this?
  20. Vanilla Tarantino
    Offline

    Vanilla Tarantino New Member

    Joined:
    Nov 12, 2009
    Messages:
    135
    Likes Received:
    0
    Trophy Points:
    0
    Glad to see something coming of this, but I'm on vacation right now so I'm pretty useless. Thanks to all those who are looking into it though!
Search tags for this page
10% indicator icon
,
android battery icon resource id
,
android battery icon xml
,
android battery xml
,
apkmanager 6.1 decompile class.arsc
,
battery image 1% 100%
,
build resource.arsc anyway
,
edit .xml baterai android 100
,
icon baterai apk
,
icon batre png
,

stat battery.xml

,

stat sys batterry xml android

,
stat sys battery 0.png
,
xml battery for android
,

xml status kelipatan baterei