MohamedRejeb / compose-dnd

Compose DND is a library that allows you to easily add drag and drop functionality to your Jetpack Compose or Compose Multiplatform projects.
Apache License 2.0
299 stars 7 forks source link

On Long press trigger #2

Closed planasmultimedia closed 6 months ago

planasmultimedia commented 6 months ago

Nice project man ! Its so useful, i was wondering if you could include a LongPress trigger so its more usable, also i'm having troubles to scroll, it detects the drag state.

Thank you for your contribution !

MohamedRejeb commented 6 months ago

Thanks! I'll try to provide clear documentation ASAP. The long press is supported, you can try this:

rememberReorderState<Type>(
    dragAfterLongPress = true
)
planasmultimedia commented 6 months ago

Cool ! Thank you very much for your quick response <3. I was also trying to enable/disable the behaviour, using an "Edit" button to enable the drag and drop feature. Is better to change between the Draggable list and a simple lazy column to enable/disable or there is any other feature?

I was having troubles with the scroll down when dragging, is there any flag?

MohamedRejeb commented 6 months ago

I'm considering adding this feature in the next release. It should be available this week with the update to compose 1.6.0.

The current implementation of the scroll down while dragging is not the best. That's why I added it only in the sample, not in the library itself. I'll try to improve it more.

MohamedRejeb commented 6 months ago

I'll close this issue since the long click is supported, can you open a new one issue for the enable/disable drag feature?

planasmultimedia commented 6 months ago

Thank man ! Looking forward to it