I\'m having a problem with using the notifyItemMoved()
method. It seems to be incorrectly displaying unmoved views.
My list has 4 element in it. What I w
Well, I handled it in a slightly different way, might help others.
Collections.swap(mItemList, fromPosition, toPosition);
// Need to do below, because NotifyItemMove only handle one sided move
Item fromItem = mItemList.get(fromPosition);
Item toItem = mItemList.get(toPosition);
notifyItemChanged(fromPosition, toItem);
notifyItemChanged(toPosition, fromItem);
I had to reorder items on a grid, and save the positions to a file. @Graeme was right, but i didn't wanted to give up on swapping. So just like @saganaut i sticked to notifyItemChanged. But only using notifyItemChanged sometimes left both swapped items on my grid with same items, so I binded the items with notifyItemChanged. It is not killing the animation, and is working as expected.