3

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?

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
Pablo Cegarra
  • 20,955
  • 12
  • 92
  • 110
  • Not sure about what you are looking for. The splitTrack attribute whether to split the track and leave a gap for the thumb drawable. In the Slider there is a gap between the thumb and the track. – Gabriele Mariotti Mar 25 '21 at 10:42

2 Answers2

3

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

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
1

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

<com.google.android.material.slider.Slider
    app:thumbRadius="0dp"
    app:haloRadius="0dp"
    />
hata
  • 11,633
  • 6
  • 46
  • 69