# DragAndDropModifierNode

Artifact: [androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/draganddrop/DragAndDropNode.kt+class:androidx.compose.ui.draganddrop.DragAndDropModifierNode) Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.6.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0) Common/AllAndroid/JVM
- Cmn

  ```
  interface DragAndDropModifierNode : DelegatableNode, DragAndDropTarget
  ```

*** ** * ** ***

> [!CAUTION]
> **This interface is deprecated.**   
> This interface is deprecated in favor to DragAndDropSourceModifierNode and DragAndDropTargetModifierNode, use this instead:
>
> ```kotlin
> DragAndDropSourceModifierNode
> ```

A `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Node` providing low level access to platform drag and drop operations. In most cases, you will want to delegate to the `https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropModifierNode` returned by the eponymous factory method.

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `[acceptDragAndDropTransfer](https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropModifierNode#acceptDragAndDropTransfer(androidx.compose.ui.draganddrop.DragAndDropEvent))(startEvent: https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropEvent)` **This function is deprecated.** This interface is deprecated in favor to DragAndDropSourceModifierNode and DragAndDropTargetModifierNode | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[drag](https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropModifierNode#drag(androidx.compose.ui.draganddrop.DragAndDropTransferData,androidx.compose.ui.geometry.Size,kotlin.Function1))( transferData: https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropTransferData, decorationSize: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size, drawDragDecoration: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` **This function is deprecated.** Use DragAndDropSourceModifierNode.requestDragAndDropTransfer instead | Cmn |

### Inherited functions

From [androidx.compose.ui.node.DelegatableNode](https://developer.android.com/reference/kotlin/androidx/compose/ui/node/DelegatableNode) `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/EmptySuper
[onDensityChange](https://developer.android.com/reference/kotlin/androidx/compose/ui/node/DelegatableNode#onDensityChange())()`

**This function is deprecated.** This interface is deprecated in favor to DragAndDropSourceModifierNode and DragAndDropTargetModifierNode
Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/EmptySuper
[onLayoutDirectionChange](https://developer.android.com/reference/kotlin/androidx/compose/ui/node/DelegatableNode#onLayoutDirectionChange())()`

**This function is deprecated.** This interface is deprecated in favor to DragAndDropSourceModifierNode and DragAndDropTargetModifierNode
Cmn From [androidx.compose.ui.draganddrop.DragAndDropTarget](https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropTarget) `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onChanged](https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropTarget#onChanged(androidx.compose.ui.draganddrop.DragAndDropEvent))(event: https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropEvent)`

**This function is deprecated.** This interface is deprecated in favor to DragAndDropSourceModifierNode and DragAndDropTargetModifierNode
Cmn `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `[onDrop](https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropTarget#onDrop(androidx.compose.ui.draganddrop.DragAndDropEvent))(event: https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropEvent)`

**This function is deprecated.** This interface is deprecated in favor to DragAndDropSourceModifierNode and DragAndDropTargetModifierNode
Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onEnded](https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropTarget#onEnded(androidx.compose.ui.draganddrop.DragAndDropEvent))(event: https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropEvent)`

**This function is deprecated.** This interface is deprecated in favor to DragAndDropSourceModifierNode and DragAndDropTargetModifierNode
Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onEntered](https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropTarget#onEntered(androidx.compose.ui.draganddrop.DragAndDropEvent))(event: https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropEvent)`

**This function is deprecated.** This interface is deprecated in favor to DragAndDropSourceModifierNode and DragAndDropTargetModifierNode
Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onExited](https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropTarget#onExited(androidx.compose.ui.draganddrop.DragAndDropEvent))(event: https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropEvent)`

**This function is deprecated.** This interface is deprecated in favor to DragAndDropSourceModifierNode and DragAndDropTargetModifierNode
Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onMoved](https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropTarget#onMoved(androidx.compose.ui.draganddrop.DragAndDropEvent))(event: https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropEvent)`

**This function is deprecated.** This interface is deprecated in favor to DragAndDropSourceModifierNode and DragAndDropTargetModifierNode
Cmn `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `[onStarted](https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropTarget#onStarted(androidx.compose.ui.draganddrop.DragAndDropEvent))(event: https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropEvent)`

**This function is deprecated.** This interface is deprecated in favor to DragAndDropSourceModifierNode and DragAndDropTargetModifierNode
Cmn

### Inherited properties

From [androidx.compose.ui.node.DelegatableNode](https://developer.android.com/reference/kotlin/androidx/compose/ui/node/DelegatableNode) `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.Node` `https://developer.android.com/reference/kotlin/androidx/compose/ui/node/DelegatableNode#node()`

**This property is deprecated.** This interface is deprecated in favor to DragAndDropSourceModifierNode and DragAndDropTargetModifierNode
Cmn

## Public functions

### acceptDragAndDropTransfer

Cmn Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.6.0) Deprecated in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0)

```
fun [acceptDragAndDropTransfer](https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropModifierNode#acceptDragAndDropTransfer(androidx.compose.ui.draganddrop.DragAndDropEvent))(startEvent: DragAndDropEvent): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
> This interface is deprecated in favor to DragAndDropSourceModifierNode and DragAndDropTargetModifierNode, use this instead:
>
> ```kotlin
> DragAndDropSourceModifierNode
> ```

The entry point to register interest in a drag and drop session for receiving data.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true to indicate interest in the contents of a drag and drop session, false indicates no interest. If false is returned, this `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` will not receive any `https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropTarget` events. All `https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropModifierNode` instances in the hierarchy will be given an opportunity to participate in a drag and drop session via this method. |

### drag

Cmn

```
fun [drag](https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropModifierNode#drag(androidx.compose.ui.draganddrop.DragAndDropTransferData,androidx.compose.ui.geometry.Size,kotlin.Function1))(
    transferData: DragAndDropTransferData,
    decorationSize: Size,
    drawDragDecoration: DrawScope.() -> Unit
): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Use DragAndDropSourceModifierNode.requestDragAndDropTransfer instead

Begins a drag and drop session for transferring data.

| Parameters |
|---|---|
| `transferData: https://developer.android.com/reference/kotlin/androidx/compose/ui/draganddrop/DragAndDropTransferData` | the data to be transferred after successful completion of the drag and drop gesture. |
| `decorationSize: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size` | the size of the drag decoration to be drawn. |
| `drawDragDecoration: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | provides the visual representation of the item dragged during the drag and drop gesture. |