androidx.compose.foundation.interaction
Interfaces
DragInteraction |
An interaction related to drag events. |
Cmn
|
FocusInteraction |
An interaction related to focus events. |
Cmn
|
HoverInteraction |
An interaction related to hover events. |
Cmn
|
Interaction |
An Interaction represents transient UI state for a component, typically separate from the actual 'business' state that a component may control. |
Cmn
|
InteractionSource |
InteractionSource represents a stream of |
Cmn
|
MutableInteractionSource |
MutableInteractionSource represents a stream of |
Cmn
|
PressInteraction |
An interaction related to press events. |
Cmn
|
Classes
DragInteraction.Cancel |
An interaction representing the cancellation of a |
Cmn
|
DragInteraction.Start |
An interaction representing a drag event on a component. |
Cmn
|
DragInteraction.Stop |
An interaction representing the stopping of a |
Cmn
|
FocusInteraction.Focus |
An interaction representing a focus event on a component. |
Cmn
|
FocusInteraction.Unfocus |
An interaction representing a |
Cmn
|
HoverInteraction.Enter |
An interaction representing a hover event on a component. |
Cmn
|
HoverInteraction.Exit |
An interaction representing a |
Cmn
|
PressInteraction.Cancel |
An interaction representing the cancellation of a |
Cmn
|
PressInteraction.Press |
An interaction representing a press event on a component. |
Cmn
|
PressInteraction.Release |
An interaction representing the release of a |
Cmn
|
Top-level functions summary
MutableInteractionSource |
Return a new |
Cmn
|
Extension functions summary
State<Boolean> |
Subscribes to this |
Cmn
|
State<Boolean> |
Subscribes to this |
Cmn
|
State<Boolean> |
Subscribes to this |
Cmn
|
State<Boolean> |
Subscribes to this |
Cmn
|
Top-level functions
MutableInteractionSource
fun MutableInteractionSource(): MutableInteractionSource
Return a new MutableInteractionSource
that can be hoisted and provided to components, allowing listening to Interaction
changes inside those components.
This should be remember
ed before it is provided to components, so it can maintain its state across compositions.
Extension functions
collectIsDraggedAsState
@Composable
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
.
collectIsFocusedAsState
@Composable
fun InteractionSource.collectIsFocusedAsState(): State<Boolean>
Subscribes to this MutableInteractionSource
and returns a State
representing whether this component is focused or not.
FocusInteraction
is typically set by androidx.compose.foundation.focusable
and focusable components, such as androidx.compose.foundation.text.BasicTextField
.
collectIsHoveredAsState
@Composable
fun InteractionSource.collectIsHoveredAsState(): State<Boolean>
Subscribes to this MutableInteractionSource
and returns a State
representing whether this component is hovered or not.
HoverInteraction
is typically set by androidx.compose.foundation.hoverable
and hoverable components.
collectIsPressedAsState
@Composable
fun InteractionSource.collectIsPressedAsState(): State<Boolean>
Subscribes to this MutableInteractionSource
and returns a State
representing whether this component is pressed or not.
PressInteraction
is typically set by androidx.compose.foundation.clickable
and clickable higher level components, such as buttons.