How can I change the color of the android progressbar(horizontal) to different sections? Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of How can I change the color of the android progressbar(horizontal) to different sections? without wasting too much if your time.

The question is published on by Tutorial Guruji team.

How can I change the color of the android progressbar(horizontal) to different sections? I want to set the color of the bar to different sections. For example, 0 to 10 is blue, 10 to 50 is red, and 50 to 100 is yellow. please help me enter image description here

Answer

you can get percent using progressbar.getProgress() method.

and change color using getProgressDrawable().setColorFilter

progressbar.getProgressDrawable().setColorFilter(Color.RED, PorterDuff.Mode.SRC_IN);

p.s] 코드나 이미지를 같이 올리셔야 답변 확룰이 올라갑니다. (You have to upload the code or image together to increase the confirmation of the answer.)

We are here to answer your question about How can I change the color of the android progressbar(horizontal) to different sections? - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji