InteractionValue

sealed class InteractionValue<T, S>

A value holder that automatically updates its value when the user is interacting with the component it is attached to. InteractionValuesIndicationNode uses instances of this class and associated animatables to update the value.

Parameters

none

The value when interactionState is InteractionState.None.

focused

The value when interactionState state is InteractionState.Focused.

hovered

The value when interactionState state is InteractionState.Hovered.

pressed

The value when interactionState state is InteractionState.Pressed.

toAnimatableValue

Converts a value of type T to an animatable value of type S.

fromAnimatableValue

Converts an animatable value of type S to a value of type T.

Type Parameters

T

The type of the value.

S

The type of the associated animatable value. This must be a Compose Color or a Float.

Properties

Link copied to clipboard

The value when animating the press interaction. It is equal to:

Link copied to clipboard
val focused: T
Link copied to clipboard
Link copied to clipboard
val hovered: T
Link copied to clipboard

The interaction state of the component this value is attached to.

Link copied to clipboard
val none: T
Link copied to clipboard
val pressed: T
Link copied to clipboard
var resting: T

The value when there is no press interaction.

Link copied to clipboard
Link copied to clipboard
var value: T

The value.