-
-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix drag & drop issues in SimpleDragCallback #985
Conversation
Previously SimpleDragCallback.getDragDirs() would allow dragging items that didn't implement IDraggable. Now such items are treated like ones that implement IDraggable but have 'isDraggable' set to false.
When dragging an item developers can prevent it from changing its position in the list by returning false from ItemTouchCallback.itemTouchOnMove(). This change only updates the 'to' property after an item has been moved successfully. Without this change the wrong 'newPosition' value could be delivered to ItemTouchCallback.itemTouchDropped().
When using ItemTouchHelper.startDrag() it's possible to get into a state where SimpleDragCallback.clearView() of the dropped item is called after the drag for the next item has already started. By this time the 'from' and 'to' values no longer refer to the item that was just dropped. So the wrong values are delivered to ItemTouchCallback.itemTouchDropped(). To clear the visual highlight from a dropped item a new callback method ItemTouchCallback.itemTouchStopDrag() is introduced.
Display a list where a subset of items can be reordered using a drag handle.
That's amazing. thank you so much for the PR. will look into it asap |
I believe danger is failing because of this coming from a fork and it ain't have the right permission to run :/ will look into that seperately |
Once again. thank you so much for the great PR. Released it as v5.4.0-b01 in case it's blocking the PR you have open on k-9 mail |
Awesome. Thanks ❤️ |
This fixes a couple of issues in
SimpleDragCallback
(see individual commits) and adds a new activity showing off how to reorder (parts of) a list.FastAdapter_reorder_list.mp4