Search code examples
androidrangeslider

How to use RangeSlider not cross each


I use material design components RangeSlider

And I want to do is when left (or right)slider touch another slider, it should not over it

I have no idea how to do it. Or exists any api that can easily achieve?

enter image description here


Solution

  • To prevent crossing each other is the standard behavior starting from the version 1.2.0-rc01 and 1.3.0-alpha02,

    Use

    implementation 'com.google.android.material:material:1.2.0-rc01'
    

    or higher versions.

    Note: The 1.2.0-rc01 is newer than 1.3.0-alpha01 (which is not fixed yet).