Closed Bender42 closed 6 years ago
https://github.com/iPaulPro/Android-ItemTouchHelper-Demo/blob/d164fba0f27c8aa38cfa7dbd4bc74d53dea44605/app/src/main/java/co/paulburke/android/itemtouchhelperdemo/RecyclerListAdapter.java#L90
Сhanges in lists Collections.swap(mItems, fromPosition, toPosition) and notifyItemMoved(fromPosition, toPosition) not the same.
You can check it by calling recyclerView.getAdapter().notifyDataSetChanged(); in SimpleItemTouchHelperCallback#clearView()
My simple solution is:
String item = mItems.get(fromPosition); expenditures.remove(fromPosition); expenditures.add(toPosition, item);
https://github.com/iPaulPro/Android-ItemTouchHelper-Demo/blob/d164fba0f27c8aa38cfa7dbd4bc74d53dea44605/app/src/main/java/co/paulburke/android/itemtouchhelperdemo/RecyclerListAdapter.java#L90
Сhanges in lists Collections.swap(mItems, fromPosition, toPosition) and notifyItemMoved(fromPosition, toPosition) not the same.
You can check it by calling recyclerView.getAdapter().notifyDataSetChanged(); in SimpleItemTouchHelperCallback#clearView()
My simple solution is: