I'm facing an issue on how to control Seekbar progress when user ONLY touching the Thumb
I knew it is a duplicated question but here are the links that gave me an idea about it this and this.
After several rounds of testing, below are my working logic result
mySeekbar.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
Rect rcThumb = mySeekbar.getThumb().getBounds();
int iWidth = rcThumb.width();
if (event.getX() >= (rcThumb.left - iWidth) && event.getX() <= (rcThumb.right + iWidth)) {
return false;
} else
return true;
}
});
Expected result
no drag or tap
during drag or tap
Problem
You can just copy and paste the above code for testing. As we know that when touching or dragging the thumb will be larger, but there is an issue were thumb will be large when not touching it. This issue will not happen often but seldom. Anyway to solve this ? Much help is appreciated.