frameworks/base/core/java/android/view/GestureDetector.java
public class GestureDetector {
public interface OnGestureListener
public interface OnDoubleTapListener
public static class SimpleOnGestureListener implements OnGestureListener, OnDoubleTapListener
...
}
public interface OnGestureListener {
/* 터치하려고 손을 대면 발생하는 이벤트 */
boolean onDown(MotionEvent e);
/* 짧은 시간 동안 누르면 발생하는 이벤트 */
void onShowPress(MotionEvent e);
/* 한 번 터치 했을 때 발생하는 이벤트 */
boolean onSingleTapUp(MotionEvent e);
/* 스크롤 시에 발생하는 이벤트 */
boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY);
/* 길게 눌렀을 때 발생하는 이벤트 */
void onLongPress(MotionEvent e);
/* 스크롤에서 끝을 살짝 튕기는 동작에서 발생하는 이벤트 */
boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY);
}
public interface OnDoubleTapListener {
/* 한 번 터치하고 다음 이벤트가 들어오지 않을 때, 한 번 터치가 확실하다고 확인 해주는 이벤트*/
boolean onSingleTapConfirmed(MotionEvent e);
/* 두 번 터치 */
boolean onDoubleTap(MotionEvent e);
/* 두 번 터치, 두 번째 터치에 Down, Move, Up 이벤트를 포함 */
boolean onDoubleTapEvent(MotionEvent e);
}
그렇다면 Multi-touch에 관련한 Gesture는 어떻게 하는거지?
à 2.2(Froyo)부터 ScaleGestureDetector 제공
참고:
http://blog.vizpei.kr/94697746
http://blog.vizpei.kr/94770746
'Android' 카테고리의 다른 글
Android Event Dispatch Process (2) (0) | 2012.06.21 |
---|---|
Android Event Dispatch Process (0) | 2012.06.21 |
Monkey Test 옵션 정리 (0) | 2012.02.20 |
인사이드 안드로이드 Chapter5 (0) | 2012.02.02 |
인사이드 안드로이드 Chapter4 (0) | 2012.02.02 |