How can I change the color of the progress bar based on how full it is?

I want the horizontal indication of the course to change dynamically dynamically, based on how full it is, that is, red below 50%, then orange, yellow, green above 85%. It can be done?

+3
source share
1 answer

The concept would be to have a red> green gradient selected as an indicator of your progress bar. He will hide the pushed out and open it as he goes. Anyway, the theory is this.

In your XML, if you do it this way, set a value android:intermediateDrawableto indicate your gradient, which you will need to do yourself.

+1
source

All Articles