Presentation is loading. Please wait.

Presentation is loading. Please wait.

Interactive Graphics in Android

Similar presentations


Presentation on theme: "Interactive Graphics in Android"— Presentation transcript:

1 Interactive Graphics in Android
CS7030: Mobile App Development

2 OnTouchEvent Event Description MotionEvent.ACTION_DOWN
New touch started MotionEvent.ACTION_MOVE Finger is moving MotionEvent.ACTION_UP Finger went up MotionEvent.ACTION_CANCEL Current event has been canceled, something else took control of the touch event MotionEvent.ACTION_POINTER_DOWN Pointer down (multi-touch) MotionEvent.ACTION_POINTER_UP Pointer up (multi-touch) CS7030: Mobile App Development

3 GestureDetector Recognize user actions that represent a series of MotiveEvent, such as flings, double-taps, long presses and scrolls. GestureDetector.SimpleOnGestureListener is an adapter class that implements all the methods of GestureDetector.OnGestureListener and GestureDetector.OnDoubleTapListener interfaces. CS7030: Mobile App Development

4 SimpleOnGestureListener methods
onDoubleTap(MotionEvent e) Notified when a double-tap occurs. onDown(MotionEvent e) Notified when a tap occurs with the down MotionEvent that triggered it. onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) Notified of a fling event when it occurs with the initial on down MotionEvent and the matching up MotionEvent. onLongPress(MotionEvent e) Notified when a long press occurs with the initial on down MotionEvent that trigged it. onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) Notified when a scroll occurs with the initial on down MotionEvent and the current move MotionEvent. CS7030: Mobile App Development


Download ppt "Interactive Graphics in Android"

Similar presentations


Ads by Google