Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,733,661 Members 44,716 Now Online
XDA Developers Android and Mobile Development Forum

[Q] Colouring a progress bar (many conditions)

Tip us?
 
teteu86
Old
#1  
teteu86's Avatar
Senior Member - OP
Thanks Meter 15
Posts: 157
Join Date: Sep 2012
Default [Q] Colouring a progress bar (many conditions)

Hi. I have the following working code to colour a progress bar:
Code:
[cf]$#BLEVN#<20?ffec1818$$#BLEVN#>=20 && #BLEVN#<50?ffdfec1c$$#BLEVN#>=50?ff36e057$[/cf]
And I am trying to add another condition (priority):

Code:
#BSTATN#=2:ff50e4ff
But I can't put an if inside of another, I've tried many ways (apparently all wrong).

Would you give me a hand?

The objective is: colour if charging. if not charging, colour according to the bat level.
The Following User Says Thank You to teteu86 For This Useful Post: [ Click to Expand ]
 
kwerdenker
Old
#2  
kwerdenker's Avatar
Recognized Themer
Thanks Meter 1994
Posts: 1,337
Join Date: Apr 2010
Location: Probably the Zooper Forums

 
DONATE TO ME
Quote:
Originally Posted by teteu86 View Post
Hi. I have the following working code to colour a progress bar:
Code:
[cf]$#BLEVN#<20?ffec1818$$#BLEVN#>=20 && #BLEVN#<50?ffdfec1c$$#BLEVN#>=50?ff36e057$[/cf]
And I am trying to add another condition (priority):

Code:
#BSTATN#=2:ff50e4ff
But I can't put an if inside of another, I've tried many ways (apparently all wrong).

Would you give me a hand?

The objective is: colour if charging. if not charging, colour according to the bat level.
I did something similar for another user here. That was about text display but the general idea on how to combine two different conditions is the same. You should be able to adapt the code posted in the linked post to your situation without much of a problem

Please use the forums for your Zooper related questions. I won't respond to PMs with questions that can/should be asked there. Thank you.
The Following User Says Thank You to kwerdenker For This Useful Post: [ Click to Expand ]
 
teteu86
Old
#3  
teteu86's Avatar
Senior Member - OP
Thanks Meter 15
Posts: 157
Join Date: Sep 2012
Quote:
Originally Posted by kwerdenker View Post
I did something similar for another user here. That was about text display but the general idea on how to combine two different conditions is the same. You should be able to adapt the code posted in the linked post to your situation without much of a problem
Thank you. I leave the code in the case someone searches for it.

Code:
[cf]$#BSTATN#=2?ff50e4ff$$#BLEVN#<20 && #BSTATN#!=2?ffec1818$$#BLEVN#>=20 && #BLEVN#<50 && #BSTATN#!=2?ffdfec1c$$#BLEVN#>=50 && #BSTATN#!=2?ff36e057$[/cf]
The Following 2 Users Say Thank You to teteu86 For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes