ExpandableState


class ExpandableState


State of the Expandable composables.

It's used to control the showing/hiding of extra information either directly or connecting it with something like a button.

Summary

Public companion functions

Saver<ExpandableStateBoolean>
@Composable
saver(
    expandAnimationSpec: AnimationSpec<Float>,
    collapseAnimationSpec: AnimationSpec<Float>
)

The default Saver implementation for ExpandableState.

Public properties

Float

While in the middle of the animation, this represents the progress from 0f (collapsed) to 1f (expanded), or the other way around.

Boolean

Represents the current state of the component, true means it's showing the extra information.

Public companion functions

saver

Added in 1.4.0-alpha07
@Composable
fun saver(
    expandAnimationSpec: AnimationSpec<Float>,
    collapseAnimationSpec: AnimationSpec<Float>
): Saver<ExpandableStateBoolean>

The default Saver implementation for ExpandableState.

Public properties

expandProgress

Added in 1.2.0
val expandProgressFloat

While in the middle of the animation, this represents the progress from 0f (collapsed) to 1f (expanded), or the other way around. If no animation is running, it's either 0f if the extra content is not showing, or 1f if the extra content is showing.

expanded

Added in 1.2.0
var expandedBoolean

Represents the current state of the component, true means it's showing the extra information. If its in the middle of an animation, the value of this field takes into account only the target of that animation.

Modifying this value triggers a change to show/hide the extra information.