I have an issue while i'm using it with GridLayout manager that the item keeps there old positions
e.g. if i moved an item from position 0 to position 3 when i click on it and print out the position it will give me 0 also
even tho i added this snippet which is can be related to this issue
public boolean onItemMove(int fromPosition, int toPosition) { if (fromPosition < toPosition) { for (int i = fromPosition; i < toPosition; i++) { Collections.swap(mItems, i, i + 1); } } else { for (int i = fromPosition; i > toPosition; i--) { Collections.swap(mItems, i, i - 1); } } notifyItemMoved(fromPosition, toPosition); return true; }
Thanks for this great demo
I have an issue while i'm using it with GridLayout manager that the item keeps there old positions e.g. if i moved an item from position 0 to position 3 when i click on it and print out the position it will give me 0 also
even tho i added this snippet which is can be related to this issue
public boolean onItemMove(int fromPosition, int toPosition) { if (fromPosition < toPosition) { for (int i = fromPosition; i < toPosition; i++) { Collections.swap(mItems, i, i + 1); } } else { for (int i = fromPosition; i > toPosition; i--) { Collections.swap(mItems, i, i - 1); } } notifyItemMoved(fromPosition, toPosition); return true; }
Thanks