Where are the Battery Icons?

Search This thread

kroegerama

Senior Member
I think, the magic happens in this line (BatteryMeterView.java, Line 190):
Code:
mShowPercent = ENABLE_PERCENT && 0 != Settings.System.getInt(context.getContentResolver(), "status_bar_show_battery_percent", 0);

Is there any way to set the system-variable "status_bar_show_battery_percent" to true?
 

kroegerama

Senior Member
Ok, figured it out. Will upload an app in a few minutes.

Edit: The problem is, that the text will be white. So you can see it only, if the battery is empty enough. Can't change this, because of line 208:
Code:
mTextPaint.setColor(0xFFFFFFFF);
 
Last edited:

AndroidRaven

Senior Member
Nov 7, 2013
77
15
Ok, figured it out. Will upload an app in a few minutes.

Edit: See Attachment. The problem is, that the text will be white. So you can see it only, if the battery is empty enough. Can't change this, because of line 208:
Code:
mTextPaint.setColor(0xFFFFFFFF);

can you guys please elaborate on how exactly to go about adding this feature to the phone, as in what software/apps needed, or small tutorial


Long time listener, first time caller

I guess total noob lol guess it was just install and activate
 
Last edited:

AndroidRaven

Senior Member
Nov 7, 2013
77
15
do you guys think it'll be possible to somehow make the percentage stand out by different color?

Or is that not possible?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    Just install my App and click on "Enable Battery Percent". Then reboot.

    New version is in attachment (changed a few strings).
    3
    And is there any way to enable it?

    I think so, working on it now.
    1
    +1! unbelieveable that google still hasnt implemented this as a stock feature...

    Sent from my Nexus 5 using Tapatalk

    Agree

    Another one I'm surprised STILL isn't in AOSP is the button you can press when changing volume to reveal all the other volume sliders. I use it ALL THE TIME on custom AOSP ROMs and even on (ugh) TouchWiz.
    1
    I try and I think I'm not the only one. Maybe it would be great if ideas would be shared here. I've got a very bad internet connection and downloading the source code takes two days...

    Sent from Google N5...
    1
    I try and I think I'm not the only one. Maybe it would be great if ideas would be shared here. I've got a very bad internet connection and downloading the source code takes two days...

    Sent from Google N5...

    Yes it has been tough, I think I need to download the the source to really understand it, been tough mainly looking at the dalvik vm code or it converted to java with jdgui. I am not sure why it doesn't show up, looks like the phone needs to be in some test mode or demo mode. I started looking at the quick tile code since it has the percent below it and also a BatteryMeterView; however, the percentage is displayed through a text view.

    Thinking I can make it a relative layout in the in the xml and then port the code to status bar icon for it to show or even change it to the way it was displayed on 4.3 and before.