androidx.compose.foundation.gestures

DraggableState

Interface · from org.jetbrains.compose.foundation:foundation:1.12.2

No hand-written docs yet.

State of draggable. Allows for a granular control of how deltas are consumed by the user as well as to write custom drag methods using drag suspend function.

interface DraggableState

Kinds of DraggableState

Anywhere a DraggableState is expected, you can pass any of these.

How to get one

Create it

Or create one of the kinds listed above.

Used by

Parameters that take a DraggableState.

Functions

drag

fun drag(
    dragPriority: MutatePriority = MutatePriority.Default,
    block: suspend DragScope.() -> Unit,
)

Call this function to take control of drag logic.

dispatchRawDelta

fun dispatchRawDelta(delta: Float)

Dispatch drag delta in pixels avoiding all drag related priority mechanisms.

Library docs

State of draggable. Allows for a granular control of how deltas are consumed by the user as well as to write custom drag methods using drag suspend function.