[MOD] Battery with actual percentage

Dr.Romca

Senior Member
Dec 12, 2008
768
207
0
Prague
This is just re-post, but for those of you who don't use BlaY0's ROM and still want good stuff:

Allright! As there were requests to do something about the readability, I've made new battery icons...
It is now, White 10pt font, Arial, with black outer Glow -> thanks for the hint, cryshop!

Download B0.8 framework-res.apk and push it via adb... ;)

Download B0.7 framework-res.apk file I'm feeling lazy, just push it via ADB :D

New White-font battery status icons!
This is the new battery progres, neat eh?
This is how charging looks like

___________________
This is the old one
Old charging animation

Install like a ROM, no wipe needed.
If you had window animations installed, this will disable them!
WARNING: This is for BlaY0's B0.6 ROM, so if you're not sure, just dowload the graphics and incorporate it to your framework-res.apk


Click "Thanks" if you like it! :D
DOWNLOAD: DrRomca_StockBatt_percent_new-signed.zip - That's for B0.6

DOWNLOAD: PNGs only - to be placed inframework-res.apk/res/drawable-mdpi/

The old one if anyone wants that..

Notes:
Inside of the battery is back to gradient, thanks to outer glow it works just as good :)
 
Last edited:

Dr.Romca

Senior Member
Dec 12, 2008
768
207
0
Prague
Because else the black text wouldn't be readable and I'd have to use white, which isn't very good while the filling is yellow...the first version I did had a white/black text depending on the filling, but the readability sucked...So I went this way...there is only 8 pixels in height in that battery....;)

Sent from my HTC Legend using XDA App
 

Dr.Romca

Senior Member
Dec 12, 2008
768
207
0
Prague
The way I did it should work for everyone:
extract the apk, mod png's (the original files are 8bit, compression level 5 - not sure if that's important) zip the apk, sign it (not sure if that's necessary)
I had problems with apktool so far, not being able to build an apk...
 

cryshop

Senior Member
Feb 25, 2010
303
99
0
Ho Chi Minh
The way I did it should work for everyone:
extract the apk, mod png's (the original files are 8bit, compression level 5 - not sure if that's important) zip the apk, sign it (not sure if that's necessary)
I had problems with apktool so far, not being able to build an apk...
Your framework-res.apk is not deodexed, that's why it's only 2.36MB, it causes FC for me.

Also, I tried to replace my framework-res.apk(4.25MB)/res/drawable/stat_sys_battery.xml with yours but won't work.

Edit : after signing my own framework-res.apk, it causes the same FCs as your apk.

Edit 2: I made a white number version :

Too bad, I can't use it :mad:
 
Last edited:

Dr.Romca

Senior Member
Dec 12, 2008
768
207
0
Prague
Edit 2: I made a white number version :

Too bad, I can't use it :mad:
OK, certainly looks pretty good, could you center the text a bit more and make those levels more smooth? I have 17 levels of fill, you only have 6.
But I definiteely like the font + it's bigger.
If you upload those frames and your framework-res.apk, I should be able to make you a good one. It also depends on what ROM you're using.
Also, could you not make the red border if the batt isn't 0%?

And btw my framework-res.apk is deodexed - i took it from BlaY0's B0.2 (Says de-odexed and no .odex files are in the system...)

edit: good idea about the occuppying the outer lines as well, and the antialiasing works good too, I'm gonna try and make my version like this..

For charging, should have more red and yellow, and less green.
Well I took that from the battery status I made - also if you notice it actually follows what level your battery is on during charging, so the full animation only displays when your battery is near 0%.
 
Last edited:

cryshop

Senior Member
Feb 25, 2010
303
99
0
Ho Chi Minh
OK, certainly looks pretty good, could you center the text a bit more and make those levels more smooth? I have 17 levels of fill, you only have 6.
But I definiteely like the font + it's bigger.
If you upload those frames and your framework-res.apk, I should be able to make you a good one. It also depends on what ROM you're using.
Also, could you not make the red border if the batt isn't 0%?
I did a quick job by using battery icons from stock rom. You can do it yourself with:
- Caviar Dream font.
- Outer Glow (color: Black, Blend mode:Normal)

I just feel quite lazy to creat them all over again :D
 

Dr.Romca

Senior Member
Dec 12, 2008
768
207
0
Prague
I see, unfortunatly I don't have such fancy options here... I'm using ulead GIF animator to create these...
But I'll see what I can do;)
 
Last edited:

Dr.Romca

Senior Member
Dec 12, 2008
768
207
0
Prague
I tried that as well, but the readability was not very good, that's why I made it bigger...try to read the file from attachment in your phone ;)
Anyway, I'd be happy to provide the PSD file containing all layers and you can modify it ;)
 

Attachments

BlaY0

Retired Recognized Developer
Sep 15, 2007
1,553
566
0
Medvode
What size do you use for these pngs? I can't check that myself coz I'm away from my comp.

EDIT: Ahh, I managed to check that on my phone. Why don't you just use 48x48 pngs, put them into drawable-mdpi and let the system resize them?

Sent from my HTC Legend
 

Dr.Romca

Senior Member
Dec 12, 2008
768
207
0
Prague
canvas dimensions are 25 x 25 pixels, font I used for my mod is Arial, actually 9pt, but it uses 10 pixels with Black outer Glow and Antialiasing. For the example I used 8pt font which while configured the same takes only 8 pixels at heigth...

EDIT: 25x25 pix is native for MDPI I believe, I've noticed that circle MOD in your ROM uses HDPI dimensions... but since I took those frames from stock battery, I'm using the original size...
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone