DragSortRecycler icon indicating copy to clipboard operation
DragSortRecycler copied to clipboard

Support to drag on long press

Open euitam opened this issue 11 years ago • 4 comments

At the moment, you are only allowed to drag items with a handler. A common and useful design pattern is also to be able to drag and drop items on long press on the item. Could it be possible to add this feature to your lib ? Thanks.

euitam avatar Jan 06 '15 22:01 euitam

OK sure, I'll take a look. I'll leave this open until done. Thanks

emileb avatar Jan 10 '15 19:01 emileb

I would also like to see long press support.

mpost avatar Feb 22 '15 10:02 mpost

@emileb any plans on this ?? i have tried to implement long press with GestorDetector but unfortunately, i didn't have a good result because long press is never detected, any tip from you ?

danielgek avatar May 22 '15 14:05 danielgek

If anyone (like me) was looking for a solution in this issue, I ended up using a hack. I start the RecyclerView with DragSortRecycler.setLeftDragArea(0), and then, the long press just set this value to the view's width, enabling the drag. When the drag is completed, I set the value to zero again.

devgutt avatar Jun 24 '16 21:06 devgutt