You can use the MotionEvent object to handle the minimum and maximum Swipe distances.
Calculate the swipe distance using the MotionEvent object i.e.., event.
@Override
public boolean onTouchEvent(MotionEvent event)
{
// TODO Auto-generated method stub
float rawX = 0.0f, dist;
switch (event.getAction())
{
case MotionEvent.ACTION_DOWN:
rawX = event.getX();
break;
case MotionEvent.ACTION_UP:
dist = event.getX() - rawX;
break;
default:
break;
}
return super.onTouchEvent(event);
}