I've created a slider and I want to remove the padding. It seem it's not possible. I know there is some padding necessary for the thump, but I'd like to take care of the padding myself.
<com.google.android.material.slider.Slider
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="0dp" />
Even with setting padding to 0 it still shows some padding. It seems the padding parameter is ignored. It also seems the thumb diameter is not taken into account for the padding.
image taken from layout inspector
How can I set the padding? What if I want a real big thumb diameter?
If you add <dimen name="mtrl_slider_track_side_padding">0dp</dimen> in your dimens.xml, the paddings is gone, Is not the ideal solution but maybe works for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With