FORUMS
Remove All Ads from XDA

[Q] How to get a progress bar satisfy two conditions?

44 posts
Thanks Meter: 25
 
By paramdinkar, Member on 22nd December 2013, 04:04 PM
Post Reply Email Thread
Hello all,

been trying to do this: battery progress bar
= red for <20%
= cyan for general discharge above 20%
=yellow while charging
=green when fully charged

i managed to get the red part right but have problems with yellow and green. for red i used #BLEVN# comparison. for cyan just the standard color option for foreground.tried using the battery status numeric tag but it just turns to white.
i'm a noob. so please tone down the answers. Thank you!
 
 
2nd January 2014, 09:32 PM |#2  
Junior Member
Thanks Meter: 2
 
More
Thumbs up this might help
Quote:
Originally Posted by paramdinkar

Hello all,

been trying to do this: battery progress bar
= red for <20%
= cyan for general discharge above 20%
=yellow while charging
=green when fully charged

i managed to get the red part right but have problems with yellow and green. for red i used #BLEVN# comparison. for cyan just the standard color option for foreground.tried using the battery status numeric tag but it just turns to white.
i'm a noob. so please tone down the answers. Thank you!

i just started using this and kinda learning how it works but i think this will help

1st put #ff00ffff as FG Color (cyan)

Code:
$#BSTATN#=2?[cf]#ffff00[/cf]$$#BLEVN#<20?[cf]#ffff0000[/cf]$$#BSTATN#=5?[cf]#008000[/cf]$

i tested and it works for me
The Following 2 Users Say Thank You to quilll For This Useful Post: [ View ] Gift quilll Ad-Free
5th January 2014, 07:59 AM |#3  
sonny_c's Avatar
Senior Member
Flag Houston
Thanks Meter: 25
 
More
Quote:
Originally Posted by quilll

i just started using this and kinda learning how it works but i think this will help

1st put #ff00ffff as FG Color (cyan)

Code:
$#BSTATN#=2?[cf]#ffff00[/cf]$$#BLEVN#<20?[cf]#ffff0000[/cf]$$#BSTATN#=5?[cf]#008000[/cf]$

i tested and it works for me

Thank you quilll. Your code gave me a good starting point. Without it I had no idea what to do.

What I wanted to do is:
battery <16% = red
battery <31% = yellow
battery <100% = green

Here is what I came up with.
Code:
$#BLEVN#<16?[cf]#ffff0000[/cf]$$#BLEVN#<31?[cf]#ffff00[/cf]$$#BLEVN#<100?[cf]#008000[/cf]$
The Following 3 Users Say Thank You to sonny_c For This Useful Post: [ View ] Gift sonny_c Ad-Free
9th January 2014, 01:34 AM |#4  
Fugi888's Avatar
Senior Member
Flag Quahog, RI
Thanks Meter: 1,970
 
Donate to Me
More
I like the idea of this. Did you get it working and if so could you post a screenshot the codes in place in the zooper settings? I have tried and can't figure out the placement. Thanks @sonny_c

Sent from my SPH-L720 using XDA Premium 4 mobile app
9th January 2014, 02:08 PM |#5  
Faxx4840's Avatar
Senior Member
Flag Welkenraedt, BE
Thanks Meter: 400
 
More
Quote:
Originally Posted by sonny_c

Thank you quilll. Your code gave me a good starting point. Without it I had no idea what to do.

What I wanted to do is:
battery <16% = red
battery <31% = yellow
battery <100% = green

Here is what I came up with.

Code:
$#BLEVN#<16?[cf]#ffff0000[/cf]$$#BLEVN#<31?[cf]#ffff00[/cf]$$#BLEVN#<100?[cf]#008000[/cf]$

I tried this code but my progress bar get transparent with this. If I change the [cf] in [cb] it works but its just the background color, I want that the bar who progress that change the color. An issue ?

Thx
10th January 2014, 03:04 AM |#6  
error404's Avatar
Senior Member
Thanks Meter: 1,107
 
Donate to Me
More
deleted
15th January 2014, 01:51 AM |#7  
sonny_c's Avatar
Senior Member
Flag Houston
Thanks Meter: 25
 
More
Quote:
Originally Posted by Fugi888

I like the idea of this. Did you get it working and if so could you post a screenshot the codes in place in the zooper settings? I have tried and can't figure out the placement. Thanks @sonny_c

Sent from my SPH-L720 using XDA Premium 4 mobile app

Fugi888,

It is working for me. Screenshots are below.


My homescreen. The battery bar stays green when the battery is above 31%. Then it changes to yellow from 16% - 30%. Finally it turns red when the battery drops below 15%.



Add a Progress Bar and and go into its settings.



The next five pics are my settings.









Tap on Advanced Parameters.



I typed the code in the highlighted box.


---------- Post added at 07:51 PM ---------- Previous post was at 07:43 PM ----------

Quote:
Originally Posted by Faxx4840

I tried this code but my progress bar get transparent with this. If I change the [cf] in [cb] it works but its just the background color, I want that the bar who progress that change the color. An issue ?

Thx

The code is working for me and I haven't had any issues. Check out my settings in my post above.
The Following 3 Users Say Thank You to sonny_c For This Useful Post: [ View ] Gift sonny_c Ad-Free
15th January 2014, 02:11 AM |#8  
Fugi888's Avatar
Senior Member
Flag Quahog, RI
Thanks Meter: 1,970
 
Donate to Me
More
[/COLOR]The code is working for me and I haven't had any issues. Check out my settings in my post above.[/QUOTE]

thanks! gonna give this a try now!
15th January 2014, 05:11 AM |#9  
sonny_c's Avatar
Senior Member
Flag Houston
Thanks Meter: 25
 
More
Here is the battery below 30%.



Sent from my SAMSUNG-SM-N900A using Tapatalk
15th January 2014, 08:29 AM |#10  
Faxx4840's Avatar
Senior Member
Flag Welkenraedt, BE
Thanks Meter: 400
 
More
Quote:
Originally Posted by sonny_c

Fugi888,

It is working for me. Screenshots are below.


My homescreen. The battery bar stays green when the battery is above 31%. Then it changes to yellow from 16% - 30%. Finally it turns red when the battery drops below 15%.




Add a Progress Bar and and go into its settings.



The next five pics are my settings.









Tap on Advanced Parameters.



I typed the code in the highlighted box.


---------- Post added at 07:51 PM ---------- Previous post was at 07:43 PM ----------

The code is working for me and I haven't had any issues. Check out my settings in my post above.

I don't know what I do wrong. I try your variable and now it works perfectly. Thank you for your help .
15th January 2014, 12:25 PM |#11  
sonny_c's Avatar
Senior Member
Flag Houston
Thanks Meter: 25
 
More
Quote:
Originally Posted by Faxx4840

I don't know what I do wrong. I try your variable and now it works perfectly. Thank you for your help .

Glad I could help.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes