MutableInteractionSource¶
interface MutableInteractionSource : InteractionSource
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¶
@Composable
fun InteractionSource.collectIsDraggedAsState(): State<Boolean>
true while a drag is active (until its DragInteraction.Stop/DragInteraction.Cancel).
collectIsFocusedAsState¶
@Composable
fun InteractionSource.collectIsFocusedAsState(): State<Boolean>
true while the component holds vanilla keyboard/controller focus.
collectIsHoveredAsState¶
@Composable
fun InteractionSource.collectIsHoveredAsState(): State<Boolean>
true while the pointer is hovering the component.
collectIsPressedAsState¶
@Composable
fun InteractionSource.collectIsPressedAsState(): State<Boolean>
true while a PressInteraction.Press is active (until its PressInteraction.Release/PressInteraction.Cancel).
tryEmit¶
abstract fun tryEmit(interaction: Interaction): Boolean
Emits interaction without suspending. Never fails to enqueue - see MutableInteractionSourceImpl.