Michał Jurczyk
09/01/2020, 9:08 PMLazyColumn
of cards and want to drag'n'drop items onto the cards from a picker.
In native UI I used to do it with setOnDragListener
listening to ACTION_DROP
and clipData
🤔AndroidView
composable in each card, with all the listeners, but wanted to make sure I am not missing something obvious before I started hacking 😅Zach Klippenstein (he/him) [MOD]
09/02/2020, 1:41 PMLazyColumn
, but have you seen dragGestureFilter
?
https://developer.android.com/reference/kotlin/androidx/compose/ui/gesture/package-summary#(androidx.compose.ui.Modifier).dragGestureFilter(androidx.compose.ui.gesture.DragObserver,%20kotlin.Function1,%20kotlin.Boolean)Michał Jurczyk
09/02/2020, 2:25 PMComposable
and the one below 🤔 And there is no drop callback, only the onStop
on the dragged Composable
, with offset as param. I guess I could do some calculation based on the offset, but no idea where to take it from there, especially in LazyColumn 🤔Zach Klippenstein (he/him) [MOD]
09/02/2020, 2:31 PMMichał Jurczyk
09/02/2020, 2:35 PMZach Klippenstein (he/him) [MOD]
09/02/2020, 2:40 PM