Change height of material slider

Viewed 416

So i'm using Android's Material Slider and want to set the thumb radius to larger than usual which i've succesfully done using app:thumbRadius="40dp" however, I'm not able to adjust the overall height of the slider therefore the thumb component is now clipping with the sliders frame:

enter image description here

My entire XML for the slider looks like the below which is embedded in a Relative Layout:

 <com.google.android.material.slider.Slider
       android:layout_width="match_parent"
       android:layout_height="200dp"
       android:layout_marginTop="20dp"
       android:layout_below="@+id/header"
       android:layout_marginStart="15dp"
       android:layout_marginEnd="30dp"
       android:contentDescription="@string/a_slider_that_sets_the_excess_fuel"
       android:stepSize="10"
       android:valueFrom="0"
       android:valueTo="100"
       android:id="@+id/slider"
       app:thumbColor="@color/blueLight"
       app:thumbElevation="20dp"
       app:thumbRadius="40dp"
       app:trackColor="@color/GreenText"
       app:trackHeight="20dp" />

Does anyone have any idea how to adjust the frame so that it doesn't clip?

1 Answers

It is a bug in the material-components library, reported here.

It looks like you will have to use a smaller thumb's size until the bug is fixed.

Related