iPaulPro / Android-ItemTouchHelper-Demo

Basic example of using ItemTouchHelper to add drag & drop and swipe-to-dismiss to RecyclerView.
Apache License 2.0
2.51k stars 499 forks source link

How can we save the new list after drag? #46

Closed AtulaGuleria closed 8 years ago

MrLepage commented 8 years ago

In onItemMove, you have to swap your list item.

After swapping, you have access to the new list.

@Override public boolean onItemMove(int fromPosition, int toPosition) { Collections.swap(yourList, fromPosition, toPosition); notifyItemMoved(fromPosition, toPosition); return true; }

AtulaGuleria commented 8 years ago

thanks.