Pointer input in Compose
Stay organized with collections
Save and categorize content based on your preferences.
Compose provides a variety of APIs to help you detect gestures that are
generated from user interactions. The APIs cover a wide range of use cases:
Some of them are
high-level
and designed to cover the most commonly used
gestures. For example, the
clickable
modifier allows easy
detection of a click, and it also provides accessibility features and
displays visual indicators when tapped (such as ripples).
There are also less commonly used gesture detectors that offer more
flexibility on a
lower level
, like
PointerInputScope.detectTapGestures
or
PointerInputScope.detectDragGestures
but don't include the extra features.
Learn more about pointer input on the following pages:
- Understand gestures
gives an explanation of the core concepts playing
a role when handling pointer input.
- Tap and press
expands on single pointer, single position events.
- Scroll
explains how to implement scrolling containers, and handles
interoperability concerns.
- Drag, swipe, and fling
shows different types of dragging of a single
pointer.
- Multi-touch
dives into situations where more than one pointer is used.
Recommended for you
Content and code samples on this page are subject to the licenses described in the
Content License
. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-03-25 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]