{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

DragInteractionKt

public final class DragInteractionKt


Summary

Public methods

static final @NonNull State<@NonNull Boolean>

Subscribes to this MutableInteractionSource and returns a State representing whether this component is dragged or not.

Public methods

collectIsDraggedAsState

@Composable
public static final @NonNull State<@NonNull BooleancollectIsDraggedAsState(@NonNull InteractionSource receiver)

Subscribes to this MutableInteractionSource and returns a State representing whether this component is dragged or not.

DragInteraction is typically set by interactions such as androidx.compose.foundation.gestures.draggable and androidx.compose.foundation.gestures.scrollable, and higher level components such as androidx.compose.foundation.lazy.LazyRow, available through androidx.compose.foundation.lazy.LazyListState.interactionSource.

Returns
@NonNull State<@NonNull Boolean>

State representing whether this component is being dragged or not