-
Notifications
You must be signed in to change notification settings - Fork 438
Gesture Event
贾俊辉 edited this page Jun 9, 2018
·
1 revision
框架内默认开启了手势事件的分发,当然您可以关闭自行处理。
如果您需要只需在视图类中实现接口OnTouchGestureListener,视图类就能收到手势事件回调。
public class GestureCover extends BaseCover implements OnTouchGestureListener {
//...
@Override
public void onDown(MotionEvent event) {
//按下事件
//...
}
@Override
public void onSingleTapUp(MotionEvent event) {
//单击事件
//...
}
@Override
public void onDoubleTap(MotionEvent event) {
//双击事件
//...
}
@Override
public void onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
//滑动事件
//...
}
@Override
public void onEndGesture() {
//手势结束
//...
}
//...
}