MultiSlider
MultiSlider copied to clipboard
Multlislider does not set min value more than 100
I have used below code to set min and max value for slider.
`MultiSlider multiSlider5 = (MultiSlider)findViewById(R.id.range_slider5);
multiSlider5.setMin(3000,true, true);
multiSlider5.setMax(5115,true, true);`
Min value is set at 100, instead of 3000. It should set 3000.
It's library internal check logic. You can't set min value greater than internal max and vice versa. That's why you get min value = 100.
Library requires add func setMinMax for set Min and Max values at the same time.
I found one solution as per current logic. We need to set setMax first then set min will solve the issue.
Fix for both situations
if (new_min > ms.getMax()) {
ms.setMax(new_max, true, true);
ms.setMin(new_min, true, true);
} else {
ms.setMin(new_min, true, true);
ms.setMax(new_max, true, true);
}
Convenience method to set both would be good, and maybe throw exceptions when setting wrong bounds, so the dev will know what is wrong right away...