https://kotlinlang.org logo
#compose
Title
# compose
l

loloof64

02/03/2021, 1:49 PM
Hi ! I've looked at the dragGestureFilter documentation (https://developer.android.com/reference/kotlin/androidx/compose/ui/gesture/package-summary#draggesturefilter), but it is defined for a Modifier. So, I can't use it for a canvas element (such as drawCircle) : is there an equivalent for setting a drag on a canvas element ?
a

Adam Powell

02/03/2021, 2:17 PM
No, there's not. You can set input handling modifiers on the whole Canvas composable and perform your own gesture management though. See
Modifier.pointerInput
and associated gesture recognition suspend functions that are extensions on that scope.
👍 1
l

loloof64

02/03/2021, 2:31 PM
Thank you : I'll listen to drag and drop on the whole canvas 🙂 (and restrict the zone with pointerInput)
👍 1
2 Views