Package icyllis.modernui.lifecycle
Enum Class Lifecycle.Event
- All Implemented Interfaces:
Serializable
,Comparable<Lifecycle.Event>
,Constable
- Enclosing class:
Lifecycle
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionConstant for onCreate event of theLifecycleOwner
.Constant for onDestroy event of theLifecycleOwner
.Constant for onPause event of theLifecycleOwner
.Constant for onResume event of theLifecycleOwner
.Constant for onStart event of theLifecycleOwner
.Constant for onStop event of theLifecycleOwner
. -
Method Summary
Modifier and TypeMethodDescriptionstatic Lifecycle.Event
downFrom
(Lifecycle.State state) Returns theLifecycle.Event
that will be reported by aLifecycle
leaving the specifiedLifecycle.State
to a lower state, ornull
if there is no valid event that can move down from the given state.static Lifecycle.Event
downTo
(Lifecycle.State state) Returns theLifecycle.Event
that will be reported by aLifecycle
entering the specifiedLifecycle.State
from a higher state, ornull
if there is no valid event that can move down to the given state.static Lifecycle.Event
upFrom
(Lifecycle.State state) Returns theLifecycle.Event
that will be reported by aLifecycle
leaving the specifiedLifecycle.State
to a higher state, ornull
if there is no valid event that can move up from the given state.static Lifecycle.Event
upTo
(Lifecycle.State state) Returns theLifecycle.Event
that will be reported by aLifecycle
entering the specifiedLifecycle.State
from a lower state, ornull
if there is no valid event that can move up to the given state.static Lifecycle.Event
Returns the enum constant of this class with the specified name.static Lifecycle.Event[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ON_CREATE
Constant for onCreate event of theLifecycleOwner
. -
ON_START
Constant for onStart event of theLifecycleOwner
. -
ON_RESUME
Constant for onResume event of theLifecycleOwner
. -
ON_PAUSE
Constant for onPause event of theLifecycleOwner
. -
ON_STOP
Constant for onStop event of theLifecycleOwner
. -
ON_DESTROY
Constant for onDestroy event of theLifecycleOwner
.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
downFrom
Returns theLifecycle.Event
that will be reported by aLifecycle
leaving the specifiedLifecycle.State
to a lower state, ornull
if there is no valid event that can move down from the given state.- Parameters:
state
- the higher state that the returned event will transition down from- Returns:
- the event moving down the lifecycle phases from state
-
downTo
Returns theLifecycle.Event
that will be reported by aLifecycle
entering the specifiedLifecycle.State
from a higher state, ornull
if there is no valid event that can move down to the given state.- Parameters:
state
- the lower state that the returned event will transition down to- Returns:
- the event moving down the lifecycle phases to state
-
upFrom
Returns theLifecycle.Event
that will be reported by aLifecycle
leaving the specifiedLifecycle.State
to a higher state, ornull
if there is no valid event that can move up from the given state.- Parameters:
state
- the lower state that the returned event will transition up from- Returns:
- the event moving up the lifecycle phases from state
-
upTo
Returns theLifecycle.Event
that will be reported by aLifecycle
entering the specifiedLifecycle.State
from a lower state, ornull
if there is no valid event that can move up to the given state.- Parameters:
state
- the higher state that the returned event will transition up to- Returns:
- the event moving up the lifecycle phases to state
-
getTargetState
- Returns:
- the state that will result from this event
-