ExpandableStateMapping

@ExperimentalWearFoundationApi
class ExpandableStateMapping<T : Any?>


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

Summary

Public functions

ExpandableState
getOrPutNew(key: T)

Returns the ExpandableState for the given key if the value is present and not null.

Public functions

getOrPutNew

Added in 1.4.0
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