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 862 forks source link

Draggable Swipeable RecyclerView is swipeable, but not draggable #403

Closed theduffster closed 6 years ago

theduffster commented 7 years ago

Sorry to bother you, but I've spent a while trying to fix this and I can't seem to find a solution. I have a RecyclerView which I am trying to make both swipeable and draggable. I implemented what I found in your example, and now my RecyclerView is swipeable but not draggable. I have tried setting onCheckCanStartDrag to true, but that didn't do anything so I doubt it's that. I have tried playing around with the initiation order, with enabling and disabling different things. However, if I remove all the swiping parts it does drag successfully. Also, my ViewHolder extends AbstractDraggableSwipeableItemViewHolder. Is this normal? Am I doing something wrong?

Here are the relevant files: Adapter

Fragment

RecyclerView Item's Layout

Fragment's Layout

h6ah4i commented 7 years ago

@theduffmaster Hi. Sorry for the very late response 🙇

I noticed that there is a mistake during the initialization process;

wrappedAdapter = recyclerViewDragDropManager.createWrappedAdapter(playingQueueAdapter);
wrappedAdapter = recyclerViewSwipeManager.createWrappedAdapter(playingQueueAdapter);

SHOULD BE:


```java
wrappedAdapter = recyclerViewDragDropManager.createWrappedAdapter(playingQueueAdapter);
wrappedAdapter = recyclerViewSwipeManager.createWrappedAdapter(wrappedAdapter);
theduffster commented 7 years ago

IT WORKS! Such a stupid oversight, thank you for the help, much appreciated!