fraper
fraper

Reputation: 61

Android Circular Progress Bar (Material Design) change color

I need to change the color of the ProgressBar element in a Lollipop (API 21) app. To be more clear, i mean, for example, to the Youtube mobile app circular progress bar. I need, for example, to make the color of the progress bar red. I've seen over the internet some examples that use a drawable.xml file but all of theme modify also the animation style of the progress bar. I'd like to maintain the Lollipop/Material Design default animation.

Thanks to all.

Upvotes: 3

Views: 5303

Answers (3)

Vorawut Manawmoo
Vorawut Manawmoo

Reputation: 21

You can use setIndicatorColor or app:indicatorColor

Upvotes: 0

Wayne J.
Wayne J.

Reputation: 213

Use "src_in" for the indeterminateTintMode and set indeterminateTint to the color you wish to change the progress bar to.

<ProgressBar
    android:id="@+id/progressBarSpinner"
    android:layout_height="75dp"
    android:layout_width="75dp"
    android:layout_gravity="center"
    android:indeterminateTint="@color/red"
    android:indeterminateTintMode="src_in"/>

Upvotes: 6

Ken Kauluwehi
Ken Kauluwehi

Reputation: 31

I just put it in the design view using the following proprieties in Android Studio. Works for me anyway

Design indeterminateTint = your color indeterminateTintMode = multiply

Text

<ProgressBar
    android:id="@+id/progressBarSpinner"
    android:layout_height="75dp"
    android:layout_width="75dp"
    android:layout_gravity="center"
    android:indeterminateTint="@color/accent_material_dark"
    android:indeterminateTintMode="multiply"/>

Upvotes: 3

Related Questions