[英]call ACTION_UP after ACTION_MOVE
How to call MotionEvent.ACTION_UP
after MotionEvent.ACTION_MOVE
into setOnTouchListener
of the Button
如何调用
MotionEvent.ACTION_UP
后MotionEvent.ACTION_MOVE
到setOnTouchListener
的的Button
Below is Small Snippets... 以下是小片段...
slide_button_start.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_MOVE:
if(!rect.contains(v.getLeft() + (int) event.getX(), v.getTop() + (int) event.getY())){
logIt("OUtSide");
v.clearFocus();
viewPager.bringToFront();
return true;
}
return false;
case MotionEvent.ACTION_DOWN:
logIt("Touch...Down");
rect = new Rect(v.getLeft(), v.getTop(), v.getRight(), v.getBottom());
return true;
case MotionEvent.ACTION_UP:
logIt("UP ha called");
return true;
}
return false;
}
});
Any Answer Appreciated....Thks 任何答案表示赞赏。。。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.