I am trying to implement fling. Problem is that I get it only when the X is on offset 0 (which means on the edge of the screen). When I try to have a fling in the middle of the screen nothing happens. This happens only on X. Y behaves OK. Here is the code:
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
float velocityY) {
try {
if ((e1.getY() < CARD_POSITION) && (e2.getY() < CARD_POSITION)
&& (Math.abs(e1.getX() - e2.getX()) >SWIPE_MIN_DISTANCE )
) {
Log.v("Fling:",Double.toString(e1.getX()));
return true;
} else {
return false;
}
} catch (Exception e) {
return false;
}
}