Is it possible to change the colour of ProgressBar in Android?

39 Views Asked by At

I have a very simple loading symbol which I created using ProgressBar in one of my Android apps. The loading symbol looks like the following: enter image description here

XML code for the ProgressBar:

<ProgressBar
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:indeterminate="true" />

I want to add some styling to the ProgressBar or make it look like the following:

enter image description here

Is it possible to do it? If so, how?

Any example code would be very helpful.

1

There are 1 best solutions below

0
Yogesh Rewani On

You can change the color by using following

   android:indeterminate="true"
   android:indeterminateTintMode="src_atop"
   android:indeterminateTint="@color/secondary"

and for styling which image you have shared can be possible by using the GIF. you can check GIF sample from https://loading.io/.

Using progress bar bar you can update some styling but not as you shared in image

Let me know if you still have doubt