Tgo1014
03/16/2023, 2:47 PMjim
03/16/2023, 3:02 PMModifier.pointerInput(Unit) {
detectTapGestures(
onPress = { /* Called when the gesture starts */ },
onDoubleTap = { /* Called on Double Tap */ },
onLongPress = { /* Called on Long Press */ },
onTap = { /* Called on Tap */ }
)
}
For most advanced usecases, you can typically use a pointerInteropFilter to get input that is a little more raw and calculate your own gestures: https://stackoverflow.com/questions/64571945/how-can-i-get-ontouchevent-in-jetpack-compose
You can also take a look at the implementation of detectTapGestures
to get a better sense of how gesture detection is implemented.Tgo1014
03/16/2023, 3:09 PMjim
03/16/2023, 3:12 PMTgo1014
03/16/2023, 3:15 PM