OnDragInitiatedListener
public interface OnDragInitiatedListener
Register an OnDragInitiatedListener to be notified when user intent to perform drag and drop operations on an item or items has been detected. Handle these events using View support for Drag and drop.
See startDragAndDrop for details.
Summary
Public methods |
|
|---|---|
abstract boolean |
Called when user intent to perform a drag and drop operation has been detected. |
Public methods
onDragInitiated
abstract boolean onDragInitiated(@NonNull MotionEvent e)
Called when user intent to perform a drag and drop operation has been detected.
The following circumstances are considered to be expressing drag and drop intent:
- Long press on selected item.
- Click and drag in the
drag regionof selected item with a pointer device. - Click and drag in drag region of un-selected item with a pointer device.
The RecyclerView item at the coordinates of the MotionEvent is not supplied as a parameter to this method as there may be multiple items selected or no items selected (as may be the case in pointer drive drag and drop.)
Obtain the current list of selected items from copySelection. If there is no selection get the item under the event using getItemDetails.
Drag region used with pointer devices is specified by inDragRegion
See startDragAndDrop for details on drag and drop implementation.
| Parameters | |
|---|---|
@NonNull MotionEvent e |
the event associated with the drag. |
| Returns | |
|---|---|
boolean |
true if drag and drop was initiated. |