I have a Xamarin.Android app containing a RecyclerView in which I want to allow the user to reorder the items using Drag & Drop. I know the basics of Drag & Drop using the StartDragAndDrop method & Drag event. I call StartDragAndDrop from the LongClick event of the item I want to move. However, here are some of the things I am having trouble figuring out how to do:
Determine the Source of the event during the Entered & Exited DragAction. Because ClipData is only available during the Drop DragAction, I was unable to use that. I need this information during Entered & Exited because I want to visually shift the other items so the user can see where this item will be placed.
Customizing the DragShadowBuilder. I need to do this because I want the Drag Shadow to be opaque, so that the user appears to be dragging the actual item.
Restricting the drag motion to vertical. Because the items are being reordered (as opposed to other scenarios where items may get dragged to different boxes or areas), I do not what the items being moved horizontally. I am not sure what the best way to do this is, although the two ideas crossing my mind were dynamically changing the layout margins of the item or dynamically modifying the Shadow Metrics of the Drag Shadow.
Are there any good examples of ways to reorder a RecyclerView? What is the best way to access drag source data in the Entered & Exited DragAction(s)? Are there any good examples of a custom DragShadowBuilder (the documentation did not give any good examples)? Are there any easy ways to restrict dragging to vertical? Thanks.