- // Touch down時觸發, e爲down時的MotionEvent
- boolean onDown(MotionEvent e);
- // 在Touch down之後一定時間(115ms)觸發,e爲down時的MotionEvent
- void onShowPress(MotionEvent e);
- // Touch up時觸發,e爲up時的MotionEvent
- boolean onSingleTapUp(MotionEvent e);
- // 滑動時觸發,e1爲down時的MotionEvent,e2爲move時的MotionEvent
- boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY);
- // 在Touch down之後一定時間(500ms)觸發,e爲down時的MotionEvent
- void onLongPress(MotionEvent e);
- // 滑動一段距離,up時觸發,e1爲down時的MotionEvent,e2爲up時的MotionEvent
- boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY);
- }
- public interface OnDoubleTapListener {
- // 完成一次單擊,並確定沒有二擊事件後觸發(300ms),e爲down時的MotionEvent
- boolean onSingleTapConfirmed(MotionEvent e);
- // 第二次單擊down時觸發,e爲第一次down時的MotionEvent
- boolean onDoubleTap(MotionEvent e);
- // 第二次單擊down,move和up時都觸發,e爲不同時機下的MotionEvent
- boolean onDoubleTapEvent(MotionEvent e);
- }
Android 淺析GestureDetector
public interface OnGestureListener {
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.