Package-level declarations

Types

Link copied to clipboard

A lifecycle owner that can be destroyed.

Link copied to clipboard

A ViewModel with a LifecycleOwner, allowing it to easily bind to lifecycle dependent components such as LiveData.

Link copied to clipboard

An owner of a sub-lifecycle of the given parentLifecycleOwner. The state of the sub-lifecycle is always in a state that is at most the parentLifecycleOwner's state. It can be a lower state either due to being limited with stateLimit or if the sub-lifecycle is destroyed.

Functions

Link copied to clipboard

Destroys all sub-lifecycle owners in this map and then clears the map.

Link copied to clipboard

Updates the LifecycleRegistry's state according to the event. This can be used instead of the default LifecycleRegistry.handleLifecycleEvent to update each LifecycleObserver for every step in the state change.

Link copied to clipboard

Updates the LifecycleRegistry's state to the given state. This can be used instead of the default LifecycleRegistry.setCurrentState to update each LifecycleObserver for every step in the state change. See handleLifecycleEventInSteps for an explanation why updating the state without steps can be problematic.

Link copied to clipboard

Creates a new LifecycleOwner that limits the state of this LifecycleOwner to Lifecycle.State.CREATED if the view is detached.