Class

ExpandableStateMapping

A class that maps from keys of the given type to ExpandableState.

Source set: Android
public class ExpandableStateMapping<T> internal constructor(
    private val initiallyExpanded: (key: T) -> Boolean,
    private val coroutineScope: CoroutineScope,
    private val expandAnimationSpec: AnimationSpec<Float>,
    private val collapseAnimationSpec: AnimationSpec<Float>,
)

A class that maps from keys of the given type to ExpandableState. An instance can be created and remembered with rememberExpandableStateMapping

Functions

getOrPutNew

Source set: Android
public fun getOrPutNew(key: T): ExpandableState

Returns the ExpandableState for the given key if the value is present and not null. Otherwise, creates a new one, puts it into the map under the given key and returns it. The parameters used to create the new ExpandableState are the ones passed to rememberExpandableStateMapping

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: