setProgress() jumps to nearest tick with seek_smoothly on
Dear Chuang Guangquan,
I really like your IndicatorSeekBar, but I found one problem.
I have this layout:
<com.warkiz.widget.IndicatorSeekBar
...
app:isb_ticks_count="3"
app:isb_seek_smoothly="true"
app:isb_thumb_adjust_auto="false"
...
/>
So I want the extra tick in the middle to be just a marker, not a real tick. This works fine when using the seekbar, but when calling IndicatorSeekBar.setProgress() initially, the thumb and indicator jump right to the nearest tick.
I think I tracked the error down to the IndicatorSeekBar.refreshSeekBarLocation() function where it says:
...
if (mTicksCount > 2) {
mProgress = mProgressArr[getClosestIndex()];
lastProgress = mProgress;
}
...
I think it should be something like:
...
if ((!mSeekSmoothly) && mTicksCount > 2) {
mProgress = mProgressArr[getClosestIndex()];
lastProgress = mProgress;
}
...
Maybe mAdjustAuto also needs to be taken into account (I'm not sure how mAdjustAuto and mSeekSmoothly play together).
Could you look into it?
Thanks!
This is actually also the cause for #174. By setting this, the seekbar gets considerably less choppy.
Dear Chuan Guangquan,
I really like your IndicatorSeekBar, but this problem really prevents me from using it in my project. Can I count on fixing it? Thanks!