[Q] Advanced Parameters code optimization - Zooper Widget General
Hi, I finally achieved what I was trying to do, but I'm wondering if there's a better way to write it all out.
It's just a basic battery progress bar color changer in Advanced Parameters.
If the battery is charging, the color is blue.
If the battery is discharging, and is less than or equal to 25% then the color is red.
If the battery is discharging, and is between 26% and 50% (inclusive) then the color is yellow.
If the battery is discharging, and is greater than 51% then the color is green.
My code:
Code:
$#BSTATN#=2?[cl]0000FF[/cl]$
$#BSTATN#!=2&&#BLEVN#<=25?[cl]FF0000[/cl]$
$#BSTATN#!=2&&#BLEVN#>25&&#BLEVN#<=50?[cl]FFFF00[/cl]$
$#BSTATN#!=2&&#BLEVN#>50?[cl]00FF00[/cl]$
Is there a more concise or better way to get my results? I'm trying to learn to expand my scope. Thanks in advance.
ubdu said:
Hi, I finally achieved what I was trying to do, but I'm wondering if there's a better way to write it all out.
It's just a basic battery progress bar color changer in Advanced Parameters.
If the battery is charging, the color is blue.
If the battery is discharging, and is less than or equal to 25% then the color is red.
If the battery is discharging, and is between 26% and 50% (inclusive) then the color is yellow.
If the battery is discharging, and is greater than 51% then the color is green.
My code:
Code:
$#BSTATN#=2?[cl]0000FF[/cl]$
$#BSTATN#!=2&&#BLEVN#<=25?[cl]FF0000[/cl]$
$#BSTATN#!=2&&#BLEVN#>25&&#BLEVN#<=50?[cl]FFFF00[/cl]$
$#BSTATN#!=2&&#BLEVN#>50?[cl]00FF00[/cl]$
Is there a more concise or better way to get my results? I'm trying to learn to expand my scope. Thanks in advance.
Click to expand...
Click to collapse
I'm going to answer myself with:
Code:
[cl]$#BSTATN#=2?0000FF$
$#BSTATN#!=2&&#BLEVN#<=25?FF0000$
$#BSTATN#!=2&&#BLEVN#>25&&#BLEVN#<=50?FFFF00$
$#BSTATN#!=2&&#BLEVN#>50?00FF00$[/cl]
Related
Battery icon with drain indicator
1. I'm wondering if there is some CAB or some program that I could see battery status (%) and drain indicator directly next to it? It would be very helpful to know what causes biggest battery drain on your system. Maybe top curtain of manila HOME tab is perfect for it? Or somewhere in top bar. See creen #1 Anyone got an idea how to do it? 2. Is there a way to move date and alarm indicator above the clock? I'll be very greatful for some help.
Battery percentage?
Anyone have a flashable mod to have the battery percentage display as numbers inside a battery (preferably not the circle, but I'll settle for something that gives me a number)? Thanks in advance!
http://forum.xda-developers.com/showthread.php?t=1270368 I'm using the stock one with the % and looks great
[Q] Changing battery indicator the easy way?
Is there an easy way (as in a simple flashing of a zip in CWM) to change the battery indicator in the notification area? The stock ICS battery indicator is not very informative (doesn't show percentage). I know I can add an icon to show battery percentage using Battery Monitor Widget, or flash another ROM, but I just want to know if something can be done to change the system battery indicator. Thanks!
Settings, Display, Display battery percentage. Enjoy.
Krzysiek_CK said: Settings, Display, Display battery percentage. Enjoy. Click to expand... Click to collapse O my that's easy... thanks! Is there a way to get rid of the icon then? It's totally redundant with the percentage being displayed...
aosimon said: Is there a way to get rid of the icon then? It's totally redundant with the percentage being displayed... Click to expand... Click to collapse I have not found a way to remove it in the stock ROM. I actually enjoy the exclamation mark when at 4% or lower.
[Q] Battery Percentage On KitKat That Is NOT White
Is there an app/can someone make an app that changes the battery percentage from white to a different color, or maybe even puts it next to the battery like in past versions? I can't live without being able to see my battery percentage all the time.
All time always on display - is it dangerous because battery %?
So, I like standard aod, all time on. Clock moves, but battery percentage is always on same spot and it is white... Is there way to remove it from aod and is there danger to destroy screen with it at all? Thanks. And one more question - is there some mod to change white balance and rgb strength in natural display mode? Thanks