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

Setting the Min And Max of RangSeeBar after onlistener is called #29

Open
GoogleCodeExporter opened this issue Jun 18, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link
Contributor

I am not too sure if this is already posted, but I had faced a problem. 
Suppose, I had range of 0-2, so when I moved the left seekbar 25%, it used to 
give min and max range as 0 and 2 but used to stay at 25% (which is confusing 
for the users, it should move to 1 (50%) or 0 ideally). So the below code sets 
the min and max value of seekbar once the seekbar is adjusted. And special 
thanks to the developer for providing the range seek bar. It is simply awesome.


final RangeSeekBar<Double> seekBar = new RangeSeekBar<Double>(0.0, 
iMatches*1.0, context);
        seekBar.setOnRangeSeekBarChangeListener(new OnRangeSeekBarChangeListener<Double>() {
            @Override
            public void onRangeSeekBarValuesChanged(RangeSeekBar<?> bar, Double minValue, Double maxValue) {
                // handle changed range values

                minValue = (double) Math.round(minValue);
                maxValue = (double) Math.round(maxValue);

                Log.i("Yoooo", "User selected new range values: MIN=" + minValue + ", MAX=" + maxValue);
                seekBar.setSelectedMinValue(minValue);
                seekBar.setSelectedMaxValue(maxValue);
            }
        });

Original issue reported on code.google.com by [email protected] on 6 Sep 2013 at 10:33

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

1 participant