如何在MotionEvent.ACTION_UP
之后MotionEvent.ACTION_MOVE
拨打setOnTouchListener
Button
以下是小片段......
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;
}
});
任何答案都赞赏......哎呀