Composable Function

collectIsDraggedAsState

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

collectIsDraggedAsState

Source set: Common
@Composable
public fun InteractionSource.collectIsDraggedAsState(): State<Boolean>

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.

Return

State representing whether this component is being dragged or not

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: