Linh
Linh

Reputation: 60973

What is the purpose of using secondaryProgressTint in Seekbar?

<SeekBar
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:max="200"
    android:progress="50"
    android:progressTint="#f00"
    android:secondaryProgressTint="#ffff00"/>

I see that SeekBar support secondaryProgressTint but after I set this, it don't affect anything (after testing on Pixel 4XL and Samsung J7).
Does this property have effect on some device or by some action steps?

Upvotes: 1

Views: 210

Answers (1)

Pranav Choudhary
Pranav Choudhary

Reputation: 2806

secondaryProgressTint defines color for secondary progress in android seekbar.

for example

enter image description here

Find more from the ProgressBar documentation listed here: http://developer.android.com/reference/android/widget/ProgressBar.html#attr_android:secondaryProgress.

In ProgressBar to show secondary progress, first define color for secondary progress by setting secondaryProgressTint attribute to the desired color.

<item name="android:secondaryProgressTint">#ffad00</item>

Then secondary secondaryProgress with secondary progress value using setSecondaryProgress(50);.

Then progress bar will be shown like this:

enter image description here

Upvotes: 1

Related Questions