In my application, I’m trying to implement the Drag&Drop functionality of items in LazyRow, LazyColumn, etc.
Is there any more or less painless way to implement this using native tools from Compose?
I want to have a high-level API that tells me when the user has started/finished dragging, automatically offsetting the item while the user is dragging it, and reordering items while the user is dragging the list item. And many other edge cases.
I tried to use this:
Modifier.pointerInput(Unit) {
detectDragGesturesAfterLongPress(
onDragStart = { _ -> }
onDrag = { _, _-> }
onDragEnd = { }
onDragCancel= { }
)
}
But faced with a lot of nuances and edge cases (the situation becomes even more challenging when using LazyVerticalGrid). That’s why I thought that such functionality should be at the level of the compose SDK, because a lot of developers face the requirement to implement this functionality. Isn’t there a ready-made solution out of the box?
I also found some third-party libraries that try to solve this issue, and some of them are good enou. But I still wonder why there is no such function out of the box. Or maybe I missed something?