Вы можете реализовать onTouchListener и сделать что-то вроде этого:
public boolean onTouch(View view, MotionEvent event) {
int currentX = event.getX();
if(event.getAction() == MotionEvent.ACTION_MOVE) {
// oldX would be defined as a private property of the class (most likely an Activity)
if(currentX > oldX) {
// moving right
oldX = currentX;
} else {
// moving left or not moving at all
oldX = currentX;
}
}
return true;
}
Вы можете поиграть с этим и заставить его работать так, как вы хотите.