lomakk / range-seek-bar

Automatically exported from code.google.com/p/range-seek-bar
0 stars 0 forks source link

setSelectedMinValue and setSelectedMaxValue wont call OnRangeSeekBarChangeListener #9

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a RangeSeekBar in the layout
2. Add a setOnRangeSeekBarChangeListener to the RangeSeekBar object 
3. Call setSelectedMinValue or setSelectedMaxValue on the RangeSeekBar object

What is the expected output? What do you see instead?

I expected the OnRangeSeekBarChangeListener to be called.

What version of the product are you using? On what operating system?

Android ofc :)

Please provide any additional information below.

It's easy to fix the issue: Just add this code at the end of 
setNormalizedMinValue and setNormalizedMaxValue:

if(listener != null) {
    listener.onRangeSeekBarValuesChanged(this, getSelectedMinValue(), getSelectedMaxValue());
}

Greetings

Timo

Original issue reported on code.google.com by timo.sch...@gmail.com on 19 Apr 2012 at 6:08

GoogleCodeExporter commented 9 years ago
This could be considered a feature. If you're changing them manually you might 
as well call onRangeSeekBarChange(...) yourself. You may actually *want* to 
change the value without the listener being called in some circumstances. I 
don't know though.

Original comment by Anonymou...@gmail.com on 7 Aug 2012 at 6:51

GoogleCodeExporter commented 9 years ago
Ok, I had the same trouble...  I agree with your idea that it's a kind of 
feature, but it would at least be more convenient if the listener inside 
RangeSeekBar were public instead of private, so you could more easily call a 
refresh, or just have a refresh function or something.  Usually a seekbar wants 
to trigger other code.

Original comment by wortham....@gmail.com on 12 Jan 2014 at 10:10