Interface

Interaction

An Interaction represents transient UI state for a component, typically separate from the actual 'business' state that a component may control.

Source set: Common
public interface Interaction

An Interaction represents transient UI state for a component, typically separate from the actual 'business' state that a component may control. For example, a button typically fires an onClick callback when the button is pressed and released, but it may still want to show that it is being pressed before this callback is fired. This transient state is represented by an Interaction, in this case PressInteraction.Press. Using Interactions allows you to build components that respond to these transient, component-owned state changes.

To emit / observe current Interactions, see MutableInteractionSource, which represents a stream of Interactions present for a given component.

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: