Compose custom drag-and-drop list

Viewed 10

I am trying to create a drag-and-drop functionality for a lazy Column in compose inspired by this article

The challenge I'm having is that I want to limit the movement, so that one cell can only go up certain amount of cells, e.g. 'ggggg' can go only up to before 'ddddd'. I can't make it work. If I add the logic to the move() function then even though list is not updated the visualization still continues. I've been trying to call onDragInterrupted() from the .composed{...} modifier but again it causes some weird artifacts.

I've spent a lot of time on this, but I think the root cause of the problem is my limited understanding of the .composed{..} modifier

Any help is appreciated

Here's my code.

0 Answers
Related