androidmaterial-components-androidandroid-slider

Hide thumb on Material Slider


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?


Solution

  • You can use the attributes:

    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