Skip to content

MutableInteractionSource

An InteractionSource that can also emit new Interactions into itself.

Constructors

MutableInteractionSource

Creates a new, independent MutableInteractionSource.

Properties

interactions

abstract val interactions: Flow<Interaction>

Functions

collectIsDraggedAsState

true while a drag is active (until its DragInteraction.Stop/DragInteraction.Cancel).

collectIsFocusedAsState

true while the component holds vanilla keyboard/controller focus.

collectIsHoveredAsState

true while the pointer is hovering the component.

collectIsPressedAsState

tryEmit

abstract fun tryEmit(interaction: Interaction): Boolean

Emits interaction without suspending. Never fails to enqueue - see MutableInteractionSourceImpl.