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

    Vanilla Tarantino Member

    Joined:
    Nov 12, 2009
    Messages:
    135
    Likes Received:
    0
    Trophy Points:
    16
    Ratings:
    +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

    cobra2 New Member

    Joined:
    Aug 2, 2010
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +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

    Vanilla Tarantino Member

    Joined:
    Nov 12, 2009
    Messages:
    135
    Likes Received:
    0
    Trophy Points:
    16
    Ratings:
    +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

    cobra2 New Member

    Joined:
    Aug 2, 2010
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Ratings:
    +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

    carlz28 Premium Member Theme Developer Premium Member

    Joined:
    Feb 28, 2010
    Messages:
    820
    Likes Received:
    1
    Trophy Points:
    18
    Ratings:
    +1
    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

    serveitup911 Member

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

    Tallica Premium Member Rescue Squad Premium Member

    Joined:
    Mar 17, 2010
    Messages:
    3,259
    Likes Received:
    1
    Trophy Points:
    101
    Location:
    Middleboro, MA
    Ratings:
    +1
    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

    sniffle Premium Member Premium Member Developer

    Joined:
    Apr 6, 2010
    Messages:
    291
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Birmingham AL
    Ratings:
    +0
    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

    carlz28 Premium Member Theme Developer Premium Member

    Joined:
    Feb 28, 2010
    Messages:
    820
    Likes Received:
    1
    Trophy Points:
    18
    Ratings:
    +1
    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

    Vanilla Tarantino Member

    Joined:
    Nov 12, 2009
    Messages:
    135
    Likes Received:
    0
    Trophy Points:
    16
    Ratings:
    +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

    chevycam94 Steel Droid ROM Developer Developer

    Joined:
    May 12, 2010
    Messages:
    1,396
    Likes Received:
    27
    Trophy Points:
    48
    Location:
    Central Ohio
    Ratings:
    +27
    Current Phone Model:
    LG G2 (VZW)
    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

    microsnook Active Member

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

    iamlost87 Member

    Joined:
    Apr 5, 2010
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Ratings:
    +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

    microsnook Active Member

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

    Help us out devs! lol
     
  15. iamlost87

    iamlost87 Member

    Joined:
    Apr 5, 2010
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    6
    Ratings:
    +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.
     
Search tags for this page
android battery xml
,
edit .xml baterai android 100
,
icon baterai apk
,
icon batre png
,
id level baterai xml stat battery
,
signapk.jar
,
stat battery.xml
,

stat sys batterry xml android

,
xml battery for android
,

xml status kelipatan baterei