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

Search This thread

zephyr1100

Senior Member
Dec 5, 2010
200
244
Cool! but the image disaappear in reverse. what i mean. when my batt is 10% left the image left is the top instead of the bottom

I tried it with one of my bitmaps. For clarity reasons I made the widget background red.



I have a widget height of 172 px so I typed [oy]#(100-BLEVN#)*172/100[/oy]
I set Screen Anchor on 'Center Top'.

Seems to work...
 
  • Like
Reactions: wakaranay

wakaranay

Senior Member
Oct 28, 2015
401
11
I tried it with one of my bitmaps. For clarity reasons I made the widget background red.



I have a widget height of 172 px so I typed [oy]#(100-BLEVN#)*172/100[/oy]
I set Screen Anchor on 'Center Top'.

Seems to work...

[oy]#(100-BLEVN#)*yyy/100[/oy] yy is my height pixel

nothing happens. i mean may bitmap is not visible
but when i type
[oy]#BLEVN#*yyy/100[/oy]
my bitmap appears
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    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]$
    3
    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%.
    01-1200.png



    Add a Progress Bar and and go into its settings.
    02-1200.png



    The next five pics are my settings.
    03-1200.png


    04-1200.png


    05-1200.png


    06-1200.png



    Tap on Advanced Parameters.
    07-1200.png



    I typed the code in the highlighted box.
    08-1200.png


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

    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.
    2
    this might help

    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
    1
    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!
    1
    how bout if i want an image instead of bar? when the batt is 100% the image if full. then when it comes to 50% the image will only show half of the image

    One way to achieve that should be (if you don't want the image to change its position):

    Create a widget with the bitmap of your choice. Adjust size of widget to your needs. The image should fill the whole wigdet. Set widget background to full transparency.
    Add a Rect to your widget. Set its Screen Anchor 'Center left'
    Height of the rectangular should be set to the height of your widget or bigger
    Width of the rectangular should be of the exact size of the widget's width
    Than go to 'Advanced parameters' and type [ox]#BLEVN#*xxx/100[/ox] --> xxx is width of your rectangular in pixels
    Set 'Drawing mode' of your rectangular to 'Clear', if you want the image to disappear completely for the percentage of battery used
    Set it to 'Normal' if you want your rectangular to mask your image.

    Another way is to play with the Advanced parameters of your image itself. If you can determine the width of your widget after adjustment of size just type [ox]#(100-BLEVN#)*xxx/100[/ox] there. After setting Screen Anchor to 'Center right' or 'Center left' and your image should move out of sight step by step (either left or right)... ;)