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

Joined
Nov 12, 2009
Messages
135
Reaction score
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.
 
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.
 
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.

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%.
 
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.
 
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!
 
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!

I think this would be a nice feature! Vanilla, have you put in a feature request to bugzilla?
 
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!

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.
 
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.

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
 
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!

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.
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

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.

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
They would be put in framework-res/res/drawable-hdpi, like the others, right?
 
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.

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

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
 
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)
 
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.
 
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.

I hope this gets up and running, it would definitely be nice.

Help us out devs! lol
 
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.

I hope this gets up and running, it would definitely be nice.

Help us out devs! lol

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.
 
Back
Top