rememberExpandableStateMapping

Functions summary

ExpandableStateMapping<T>
@Composable
@ExperimentalWearFoundationApi
<T : Any?> rememberExpandableStateMapping(
    initiallyExpanded: (key) -> Boolean,
    expandAnimationSpec: AnimationSpec<Float>,
    collapseAnimationSpec: AnimationSpec<Float>
)

Create and remember a mapping from keys to ExpandableStates ExpandableStates can be requested by key, and we will created with the parameters given here when a mapping didn't exist before.

Functions

rememberExpandableStateMapping

@Composable
@ExperimentalWearFoundationApi
fun <T : Any?> rememberExpandableStateMapping(
    initiallyExpanded: (key) -> Boolean = { false },
    expandAnimationSpec: AnimationSpec<Float> = ExpandableItemsDefaults.expandAnimationSpec,
    collapseAnimationSpec: AnimationSpec<Float> = ExpandableItemsDefaults.collapseAnimationSpec
): ExpandableStateMapping<T>

Create and remember a mapping from keys to ExpandableStates ExpandableStates can be requested by key, and we will created with the parameters given here when a mapping didn't exist before. This is mainly useful when you want to have a variable number of expandables, that can change at runtime (for example, elements on a ScalingLazyColumn)

Parameters
initiallyExpanded: (key) -> Boolean = { false }

A function to compute the initial state given the key.

expandAnimationSpec: AnimationSpec<Float> = ExpandableItemsDefaults.expandAnimationSpec

The AnimationSpec to use when showing the extra information.

collapseAnimationSpec: AnimationSpec<Float> = ExpandableItemsDefaults.collapseAnimationSpec

The AnimationSpec to use when hiding the extra information.