Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multlislider does not set min value more than 100 #59

Open
ravikanasagra1 opened this issue May 25, 2017 · 5 comments
Open

Multlislider does not set min value more than 100 #59

ravikanasagra1 opened this issue May 25, 2017 · 5 comments

Comments

@ravikanasagra1
Copy link

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.

@bmx666
Copy link
Contributor

bmx666 commented May 26, 2017

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.

@bmx666
Copy link
Contributor

bmx666 commented May 26, 2017

Library requires add func setMinMax for set Min and Max values at the same time.

@ravikanasagra1
Copy link
Author

I found one solution as per current logic. We need to set setMax first then set min will solve the issue.

@bmx666
Copy link
Contributor

bmx666 commented May 26, 2017

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);
}

@joaoBeno
Copy link

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants