Android 手势识别类 ( 一 ) GestureDetector 基本介绍
为了加强鼠标响应事件,Android提供了GestureDetector手势识别类。通过GestureDetector.OnGestureListener来获取当前被触发的操作手势(Single Tap Up、Show Press、Long Press、Scroll、Down、Fling),具体包括以下几种: boolean onDoubleTap(MotionEvent e) 解释:双击的第二下Touch down时触发 boolean onDoubleTapEvent(MotionEvent e) 解释:双击的第二下Touch down和up都会触发,可用e.getAction()区分。 boolean onDown(MotionEvent e) 解释:Touch down时触发 boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) 解释:Touch了滑动一点距离后,up时触发。 void onLongPress(MotionEvent e) 解释:Touch了不移动一直T...
