DragSortRecycler
DragSortRecycler copied to clipboard
Using DragSort recycler with SwipeRefreshLayout
Hello,
I have implemented your DragSort Recycler in my RecyclerView. I am also trying to implement the SwipeRefreshLayout on the recyclerview..
The problem I am facing is when I long press and drag the view in downward motion, the SwipeRefreshLayout's setOnRefreshListener gets called preventing me from sorting the view items. I am able to move items in the upward motion.
Any suggestions on this would be very helpful
i am facing similar problem as yours. what i am planning to do is, to add / remove either swiperefreshlayout or dragsortrecycler listener programmatically... or maybe dynamically control the swiperefreshlayout using dragstart or dragdrop function...
I was able to get around this problem by enabling and disabling onDragStart/Stop override methods
dragSortRecycler.setOnDragStateChangedListener(new DragSortRecycler.OnDragStateChangedListener() {
@Override
public void onDragStart() {
mRefreshLayout.setEnabled(false);
}
@Override
public void onDragStop() {
mRefreshLayout.setEnabled(true);
}
});
Thanks for this report and for the potential fix, I have not tried this yet so I will leave this open.