androidx.lifecycle

Classes

AndroidViewModel

Application context aware ViewModel.

Lifecycle

Defines an object that has an Android Lifecycle.

LifecycleRegistry

An implementation of Lifecycle that can handle multiple observers.

LifecycleService

A Service that is also a LifecycleOwner.

LiveData

LiveData is a data holder class that can be observed within a given lifecycle.

LiveDataReactiveStreams

Adapts LiveData input and output to the ReactiveStreams spec.

MediatorLiveData

LiveData subclass which may observe other LiveData objects and react on OnChanged events from them.

MutableLiveData

LiveData which publicly exposes #setValue(T) and #postValue(T) method.

ProcessLifecycleOwner

Class that provides lifecycle for the whole application process.

ServiceLifecycleDispatcher

Helper class to dispatch lifecycle events for a service.

Transformations

Transformation methods for LiveData.

ViewModel

ViewModel is a class that is responsible for preparing and managing the data for an Activity or a Fragment.

ViewModelProvider

An utility class that provides ViewModels for a scope.

ViewModelProviders

Utilities methods for ViewModelStore class.

ViewModelStore

Class to store ViewModels.

ViewModelStores

Factory methods for ViewModelStore class.

Annotations

OnLifecycleEvent

Extension functions summary

For org.reactivestreams.Publisher
LiveData<T>
Publisher<T>.toLiveData()

Creates an observable LiveData stream from a ReactiveStreams Publisher.

For LiveData
Publisher<T>

Adapts the given LiveData stream to a ReactiveStreams Publisher.

For ViewModelProvider
VM

Returns an existing ViewModel or creates a new one in the scope (usually, a fragment or an activity), associated with this ViewModelProvider.

Extension functions

get

inline fun <reified VM : ViewModel> ViewModelProvider.get(): VM

Returns an existing ViewModel or creates a new one in the scope (usually, a fragment or an activity), associated with this ViewModelProvider.

toLiveData

inline fun <T> Publisher<T>.toLiveData(): LiveData<T>

Creates an observable LiveData stream from a ReactiveStreams Publisher.

toPublisher

inline fun <T> LiveData<T>.toPublisher(lifecycle: LifecycleOwner): Publisher<T>

Adapts the given LiveData stream to a ReactiveStreams Publisher.