Malo
Malo

Reputation: 1586

how to change line and thumb color in slider android material design?

i have a rangelsider created in xml like the code below

     <com.google.android.material.slider.RangeSlider
android:id="@+id/dataSlider"
android:layout_height="5dp"
android:layout_width="match_parent"
 android:valueFrom="0.0"
android:visibility="visible"
android:valueTo="100.0"
app:values="@array/initial_slider_values"  />

i want to change the color of thumb circle and make it smaller, also want to change the line color , the styling doesn't work

Upvotes: 4

Views: 10430

Answers (2)

&#199;ağrı
&#199;ağrı

Reputation: 49

You can use app:trackColor="Your color" for changing color of the track

Upvotes: 3

Ali Moghadam
Ali Moghadam

Reputation: 1156

You can use these attrbutes

Tick

app:tickColor
app:tickColorActive
app:tickColorInactive

Thumb

app:thumbColor
app:haloColor
app:thumbStrokeColor

app:thumbRadius

More attrbutes and implemention https://material.io/components/sliders/android#using-sliders

Upvotes: 13

Related Questions