I'm on a Lollipop device (MotoG 2014), I read about progress bar tinting, but this is not working...I get the default progress bar color. What am I missing here?
<ProgressBar style="?android:attr/progressBarStyleLarge" android:layout_width="50dp" android:layout_height="50dp" android:backgroundTintMode="src_in" android:indeterminate="true" android:indeterminateTint="#f00" />
Many thanks.
You need to call setLevel on the ClipDrawable. It takes a value from 0 to 10000. So, progress. setLevel(2500) would be 25% full.
Try changing your ProgressBar
to this
<ProgressBar android:id="@+id/view_progress" style="?android:attr/progressBarStyleLarge" android:layout_width="50dp" android:layout_height="50dp" android:indeterminate="true" android:indeterminateTintMode="src_in" android:indeterminateTint="@color/red" />
Also you can do it programmaticaly doing this :
ProgressBar progressBar; progressBar = (ProgressBar)findViewById(R.id.view_progress); progressBar.getProgressDrawable().setColorFilter(Color.RED, Mode.SRC_IN);
Setting in ProgressBar Tint color
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With