pub struct MutableInteractionSource { /* private fields */ }Implementations§
Source§impl MutableInteractionSource
impl MutableInteractionSource
pub fn new() -> Self
pub fn with_runtime(runtime: RuntimeHandle) -> Self
pub fn id(&self) -> u64
pub fn press(&self, press_position: Point) -> PressInteractionPress
pub fn release(&self, press: PressInteractionPress)
pub fn cancel(&self, press: PressInteractionPress)
Sourcepub fn enter_hover(&self) -> HoverInteractionEnter
pub fn enter_hover(&self) -> HoverInteractionEnter
Reports that a pointer came to rest over a node, Compose’s
emit(HoverInteraction.Enter()), and returns the enter to end it
with.
Sourcepub fn exit_hover(&self, enter: HoverInteractionEnter)
pub fn exit_hover(&self, enter: HoverInteractionEnter)
Reports that the pointer enter reported left.
pub fn emit(&self, interaction: Interaction)
Sourcepub fn collectIsPressedAsState(&self) -> State<bool>
pub fn collectIsPressedAsState(&self) -> State<bool>
Returns whether the interaction source is currently pressed as a
reactive State.
Mirrors Jetpack Compose: InteractionSource.collectIsPressedAsState().
The value flips to true when a PressInteraction::Press is emitted
and back to false once every active press has seen a matching
PressInteraction::Release or PressInteraction::Cancel. Reading the
returned state inside a composable subscribes the enclosing recompose
scope, so the composable recomposes whenever the pressed state changes.
Sourcepub fn collectIsHoveredAsState(&self) -> State<bool>
pub fn collectIsHoveredAsState(&self) -> State<bool>
Returns whether a pointer rests over a node of this source as a
reactive State: true from a HoverInteraction::Enter until
every enter has seen its HoverInteraction::Exit.
Mirrors Jetpack Compose: InteractionSource.collectIsHoveredAsState().