This guide describes how to write apps that allow users to interact with an app via touch gestures. Android provides a variety of APIs to help you create and detect gestures.
Although your app should not depend on touch gestures for basic behaviors (since the gestures may not be available to all users in all contexts), adding touch-based interaction to your app can greatly increase its usefulness and appeal.
To provide users with a consistent, intuitive experience, your app should follow the accepted Android conventions for touch gestures. The Gestures design guide shows you how to use common gestures in Android apps. Also see the Material Design guide for Material motion.
For more information about this topic, read the following related guides:
- Detect common gestures
Learn how to detect basic touch gestures such as scrolling, flinging, and double-tapping, using
- Track touch and pointer movements
- Learn how to track movement.
- Animate a scroll gesture
Learn how to use scrollers (
OverScroller) to produce a scrolling animation in response to a touch event.
- Handle multi-touch gestures
- Learn how to detect multi-pointer (finger) gestures.
- Drag and scale
- Learn how to implement touch-based dragging and scaling.
- Manage touch events in a ViewGroup
- Learn how to manage touch events in a
ViewGroupto ensure that touch events are correctly dispatched to their target views.