androidx.compose.ui.draganddrop

Interfaces

DragAndDropModifierNode

This interface is deprecated. This interface is deprecated in favor to DragAndDropSourceModifierNode and DragAndDropTargetModifierNode

Cmn
DragAndDropSourceModifierNode

A Modifier.Node that can be used as a source for platform drag and drop operations.

Cmn
DragAndDropStartTransferScope

A scope that allows starting a drag and drop session.

Cmn
DragAndDropTarget

Provides a means of receiving a transfer data from a drag and drop session.

Cmn
DragAndDropTargetModifierNode

A Modifier.Node that can be used as a target for platform drag and drop operations.

Cmn

Classes

DragAndDropEvent

A representation of an event sent by the platform during a drag and drop operation.

Cmn
android
DragAndDropTransferData

Definition for a type representing transferable data.

Cmn
android

Top-level functions summary

DragAndDropModifierNode

This function is deprecated. Use DragAndDropSourceModifierNode instead

Cmn
DragAndDropModifierNode
DragAndDropModifierNode(
    shouldStartDragAndDrop: (event: DragAndDropEvent) -> Boolean,
    target: DragAndDropTarget
)

This function is deprecated. Use DragAndDropTargetModifierNode instead

Cmn
DragAndDropSourceModifierNode

Creates a DragAndDropSourceModifierNode for starting platform drag and drop sessions with the intention of transferring data.

Cmn
DragAndDropTargetModifierNode
DragAndDropTargetModifierNode(
    shouldStartDragAndDrop: (event: DragAndDropEvent) -> Boolean,
    target: DragAndDropTarget
)

Creates a DragAndDropTargetModifierNode for receiving transfer data from platform drag and drop sessions.

Cmn

Extension functions summary

Set<String>

The mime types present in a DragAndDropEvent

android
DragEvent

Returns the backing DragEvent to read platform specific data

android

Top-level functions

DragAndDropModifierNode

fun DragAndDropModifierNode(): DragAndDropModifierNode

Creates a Modifier.Node for starting platform drag and drop sessions with the intention of transferring data. A drag and stop session is started by calling DragAndDropModifierNode.drag.

DragAndDropModifierNode

fun DragAndDropModifierNode(
    shouldStartDragAndDrop: (event: DragAndDropEvent) -> Boolean,
    target: DragAndDropTarget
): DragAndDropModifierNode

Creates a Modifier.Node for receiving transfer data from platform drag and drop sessions. All DragAndDropModifierNode instances provided by this function may also start drag and drop sessions by calling DragAndDropModifierNode.drag.

Parameters
shouldStartDragAndDrop: (event: DragAndDropEvent) -> Boolean

allows for inspecting the start DragAndDropEvent for a given session to decide whether or not the provided DragAndDropTarget would like to receive from it.

target: DragAndDropTarget

allows for receiving events and transfer data from a given drag and drop session.

DragAndDropSourceModifierNode

fun DragAndDropSourceModifierNode(onStartTransfer: DragAndDropStartTransferScope.(Offset) -> Unit): DragAndDropSourceModifierNode

Creates a DragAndDropSourceModifierNode for starting platform drag and drop sessions with the intention of transferring data.

Parameters
onStartTransfer: DragAndDropStartTransferScope.(Offset) -> Unit

the callback function that is invoked when drag and drop session starts. It takes an Offset parameter representing the start position of the drag.

DragAndDropTargetModifierNode

fun DragAndDropTargetModifierNode(
    shouldStartDragAndDrop: (event: DragAndDropEvent) -> Boolean,
    target: DragAndDropTarget
): DragAndDropTargetModifierNode

Creates a DragAndDropTargetModifierNode for receiving transfer data from platform drag and drop sessions.

Parameters
shouldStartDragAndDrop: (event: DragAndDropEvent) -> Boolean

allows for inspecting the start DragAndDropEvent for a given session to decide whether or not the provided DragAndDropTarget would like to receive from it.

target: DragAndDropTarget

allows for receiving events and transfer data from a given drag and drop session.

Extension functions

mimeTypes

fun DragAndDropEvent.mimeTypes(): Set<String>

The mime types present in a DragAndDropEvent

toAndroidDragEvent

fun DragAndDropEvent.toAndroidDragEvent(): DragEvent

Returns the backing DragEvent to read platform specific data