DragAndDropModifierNode
Interface
Common
Deprecated This interface is deprecated in favor to DragAndDropSourceModifierNode and DragAndDropTargetModifierNode
interface DragAndDropModifierNode : DelegatableNode, DragAndDropTarget
A Modifier.Node
providing low level access to platform drag and drop operations. In most cases,
you will want to delegate to the DragAndDropModifierNode
returned by the eponymous factory
method.
Functions
fun drag(
transferData: DragAndDropTransferData,
decorationSize: Size,
drawDragDecoration: DrawScope.() -> Unit,
)
Begins a drag and drop session for transferring data.
Parameters
transferData | the data to be transferred after successful completion of the drag and drop gesture. |
decorationSize | the size of the drag decoration to be drawn. |
drawDragDecoration | provides the visual representation of the item dragged during the drag and drop gesture. |
fun acceptDragAndDropTransfer(startEvent: DragAndDropEvent): Boolean
The entry point to register interest in a drag and drop session for receiving data.
All DragAndDropModifierNode
instances in the hierarchy will be given an opportunity to
participate in a drag and drop session via this method.
Returns
true to indicate interest in the contents of a drag and drop session, false indicates no interest. If false is returned, this Modifier will not receive any DragAndDropTarget events. |