0

I want my SeekBar to only change progress when the thumb is dragged. Right now it also changes position when anywhere on the progress bar is clicked. Is there a way to remove that extra functionality?

artless noise
  • 21,212
  • 6
  • 68
  • 105
ElectronAnt
  • 2,115
  • 7
  • 22
  • 39

1 Answers1

0

I suppose you could use SeekBar.getThumbOffset along with SeekBar.getProgress in the onStartTrackingTouch method to filter touch events that don't lie in that area using a touch listener:

@Override
public boolean onTouchEvent(MotionEvent event) {
    int x = (int)event.getX();
    int y = (int)event.getY();
    switch (event.getAction()) {
        case MotionEvent.ACTION_DOWN:
        case MotionEvent.ACTION_MOVE:
        case MotionEvent.ACTION_UP:
    }
return false;
}

Is there an easy way? I don't think so.

Jack Satriano
  • 1,999
  • 1
  • 13
  • 17