h6ah4i / android-advancedrecyclerview

RecyclerView extension library which provides advanced features. (ex. Google's Inbox app like swiping, Play Music app like drag and drop sorting)
https://advancedrecyclerview.h6ah4i.com/
Apache License 2.0
5.32k stars 860 forks source link

How to make the drag mode active only after Long press on any draggable item ? to avoid accidental drag. #482

Open nirocknrk opened 5 years ago

nirocknrk commented 5 years ago

Is it possible to make the dragging mode active only when the user Long press on an item which he intended drag? Because accidentally dragging is happening with the current way when user scroll through recyclerview ? Thank you

janlukes commented 5 years ago

Please read the source examples. You can find such behaviour in file DraggableGridExampleFragment.java

Specifically mRecyclerViewDragDropManager.setInitiateOnLongPress(true); mRecyclerViewDragDropManager.setInitiateOnMove(false); mRecyclerViewDragDropManager.setLongPressTimeout(750);

nirocknrk commented 5 years ago

Thank for the information. With that changes long press to start dragging is working fine. But "SWIPE" to dismiss is not working. Because my 'drag_handle' view is filling the whole child item layout since i want the drag when user long click on any place of the child item view. Because of this swipe right/left is not get recognised?

Since dragging is active only on long press SIWPE right/left gestures shouldn't have any impact isn't it? any work around for this?