-
Notifications
You must be signed in to change notification settings - Fork 399
FAQ
谷进杰 edited this page May 13, 2018
·
7 revisions
1、How to add a Listener
rangeSeekBar.setOnRangeChangedListener(new OnRangeChangedListener() {
@Override
public void onRangeChanged(RangeSeekBar view, float min, float max, boolean isFromUser) {
//min is left seekbar value, max is right seekbar value
}
@Override
public void onStartTrackingTouch(RangeSeekBar view, boolean isLeft) {
//start tracking touch
}
@Override
public void onStopTrackingTouch(RangeSeekBar view, boolean isLeft) {
//stop tracking touch
}
});
2、How to use java code to update some attributes when you want
RangeSeekBar
support setter and getter for all attributes, so just do what you want to do in the Listener!
If you want to change one of the seekbar's attributes, you can use getLeftSeekBar()
or getRightSeekBar()
to do it.
Just enjoy it !
3、How to set Value
if the single
mode RangeSeekBar, you can use RangeSeekBar.setValue(float value)
.
if the range
mode RangeSeekBar, you can use RangeSeekBar.setValue(float min, float max)