I need to detect in my application when user stop moving across a specific view. I'm creating something similar to marque text in my application which can interact while user is touching the view and moving across it. And I need to start scrolling the view after user lifts his finger. As I notices if I move my finger across the view a few seconds and when I lift my finger the MotionEvent.ACTION_UP
is not called. The last event which I capture is ACTION_MOVE
. So how can I detect when user lifts his finger after moving across the view a few seconds? Is there some kind of function which can detect that?
Here is the code which I'm using :
txt.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, final MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
Log.e("","event down : "+event.getAction());
handler.removeCallbacks(runnable);
break;
case MotionEvent.ACTION_UP:
Log.e("","event up : "+event.getAction());
if(myTimer!=null){
myTimer.cancel();
}
break;
case MotionEvent.ACTION_MOVE:
Log.d("","move");
// handler.removeCallbacks(runnable);
checkX();
break;
}
return true;
}
});
Thanks in advance!