androidx.lifecycle.viewmodel
Interfaces
CreationExtras.Key |
Key for the elements of |
Cmn
|
Classes
CreationExtras |
A map-like object holding pairs of |
Cmn
|
InitializerViewModelFactoryBuilder |
DSL for constructing a new |
Cmn
|
MutableCreationExtras |
A modifiable |
Cmn
|
ViewModelInitializer |
Holds a |
Cmn
android
N
|
Objects
CreationExtras.Empty |
An empty read-only |
Cmn
|
Annotations
Top-level functions summary
inline ViewModelProvider.Factory |
viewModelFactory(builder: InitializerViewModelFactoryBuilder.() -> Unit) Creates an |
Cmn
|
Extension functions summary
operator Boolean |
CreationExtras.contains(key: CreationExtras.Key<*>) Checks if the |
Cmn
|
inline Unit |
<VM : ViewModel> InitializerViewModelFactoryBuilder.initializer( Add an initializer to the |
Cmn
|
operator MutableCreationExtras |
CreationExtras.plus(creationExtras: CreationExtras) Creates a new read-only |
Cmn
|
operator Unit |
MutableCreationExtras.plusAssign(creationExtras: CreationExtras) Appends or replaces all entries from the given |
Cmn
|
Top-level functions
viewModelFactory
inline fun viewModelFactory(builder: InitializerViewModelFactoryBuilder.() -> Unit): ViewModelProvider.Factory
Creates an InitializerViewModelFactory
with the initializers provided in the builder.
Extension functions
contains
operator fun CreationExtras.contains(key: CreationExtras.Key<*>): Boolean
Checks if the CreationExtras
contains the given key
.
This method allows to use the key in creationExtras
syntax for checking whether an key
is contained in the CreationExtras
.
initializer
inline fun <VM : ViewModel> InitializerViewModelFactoryBuilder.initializer(
noinline initializer: CreationExtras.() -> VM
): Unit
Add an initializer to the InitializerViewModelFactoryBuilder
plus
operator fun CreationExtras.plus(creationExtras: CreationExtras): MutableCreationExtras
Creates a new read-only CreationExtras
by replacing or adding entries to this
extras from another creationExtras
.
The returned CreationExtras
preserves the entry iteration order of the original CreationExtras
.
Those entries of another creationExtras
that are missing in this
extras are iterated in the end in the order of that creationExtras
.
plusAssign
operator fun MutableCreationExtras.plusAssign(creationExtras: CreationExtras): Unit
Appends or replaces all entries from the given creationExtras
in this
mutable extras.