Hide thumb on Material Slider

1.9k Views Asked by At

I'm migrating from AppCompatSeekBar to material.slider.Slider

Removing the thumb on the SeekBar was easy using splitTrack="false".

How can I achieve the same with the Slider?

2

There are 2 best solutions below

0
On BEST ANSWER

You can use the attributes:

  • app:haloRadius
  • app:thumbRadius

To avoid the halo you can use app:haloRadius. Use 10dp as the thumbRadius:

        <com.google.android.material.slider.Slider
            app:haloRadius="10dp"
            ../>

enter image description here

You can also remove the thumb and the halo using the attribute app:thumbRadius="0dp"

       <com.google.android.material.slider.Slider
            app:thumbRadius="0dp"
            app:haloRadius="0dp"
            ..../>

enter image description here

0
On

How about setting 0dp to app:thumbRadius and/or app:haloRadius?

<com.google.android.material.slider.Slider
    app:thumbRadius="0dp"
    app:haloRadius="0dp"
    />