The progress change event can be notified by onProgressChanged in interface OnSeekBarChangeListener().
But how to know whether a change decrease the progress or increase it? Or is there an interface or method like:
onSeekBarProgressDecreased(....) or onSeekBarProgressIncreased(...)
There is no interface available for progress decrease or increase events. You have to keep track of it. You can use something like this.
int prevProgress;
mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){
@Override
public oid onProgressChanged (SeekBar seekBar, int progress, boolean fromUser){
int diff = progress - prevProgress;
if(diff > 0){
//increase
}
else{
//decrease
}
prevProgress = progress;
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With