I have four different color button and one progress bar this now my query is when i click on any button so progressbar will progress with same color serially say for example I have fou diff. color button orange,blue,green,red now when I click on orange button so progress bar will progress with orange color next I click on blue color so progress bar will progress with blue color when again click on orange color so progrss bar progress with orange color but not new state that progress with previous pregresed orange color how can i do that? Please let me know if any idea it will very helpful for me thanks in advance.
Question posted in Android Studio
The official documentation can be found here.
The official documentation can be found here.
2
Answers
I don’t know how to do that with progressBar, but you can create a Layout in the shape of progressBar with four views separated with vertical guidelines, and color each view with different color. Then programatically change the percents of the guidelines and the visibility of the view on buttons click.
Use material design Progress indicator and change indicator color dynamically when pressing on the specific button.
add dependency in your gradle,
sample.xml,
SampleActivity.kt,