WithLifecycleStateKt

public final class WithLifecycleStateKt


Summary

Public methods

static final @NonNull R
<R extends Object> WithLifecycleStateKt.withCreated(
    Lifecycle receiver,
    Function0<R> block
)

Run block with this Lifecycle in a Lifecycle.State of at least Lifecycle.State.CREATED and resume with the result.

static final @NonNull R
<R extends Object> WithLifecycleStateKt.withCreated(
    LifecycleOwner receiver,
    Function0<R> block
)

Run block with this LifecycleOwner's Lifecycle in a Lifecycle.State of at least Lifecycle.State.CREATED and resume with the result.

static final @NonNull R
<R extends Object> WithLifecycleStateKt.withResumed(
    Lifecycle receiver,
    Function0<R> block
)

Run block with this Lifecycle in a Lifecycle.State of at least Lifecycle.State.RESUMED and resume with the result.

static final @NonNull R
<R extends Object> WithLifecycleStateKt.withResumed(
    LifecycleOwner receiver,
    Function0<R> block
)

Run block with this LifecycleOwner's Lifecycle in a Lifecycle.State of at least Lifecycle.State.RESUMED and resume with the result.

static final @NonNull R
<R extends Object> WithLifecycleStateKt.withStarted(
    Lifecycle receiver,
    Function0<R> block
)

Run block with this Lifecycle in a Lifecycle.State of at least Lifecycle.State.STARTED and resume with the result.

static final @NonNull R
<R extends Object> WithLifecycleStateKt.withStarted(
    LifecycleOwner receiver,
    Function0<R> block
)

Run block with this LifecycleOwner's Lifecycle in a Lifecycle.State of at least Lifecycle.State.STARTED and resume with the result.

static final @NonNull R
<R extends Object> WithLifecycleStateKt.withStateAtLeast(
    Lifecycle receiver,
    Lifecycle.State state,
    Function0<R> block
)

Run block with this Lifecycle in a Lifecycle.State of at least state and resume with the result.

static final @NonNull R
<R extends Object> WithLifecycleStateKt.withStateAtLeast(
    LifecycleOwner receiver,
    Lifecycle.State state,
    Function0<R> block
)

Run block with this LifecycleOwner's Lifecycle in a Lifecycle.State of at least state and resume with the result.

Public methods

WithLifecycleStateKt.withCreated

public static final @NonNull R <R extends Object> WithLifecycleStateKt.withCreated(
    Lifecycle receiver,
    Function0<R> block
)

Run block with this Lifecycle in a Lifecycle.State of at least Lifecycle.State.CREATED and resume with the result. Throws the CancellationException if the lifecycle has reached Lifecycle.State.DESTROYED by the time of the call or before block is able to run.

WithLifecycleStateKt.withCreated

public static final @NonNull R <R extends Object> WithLifecycleStateKt.withCreated(
    LifecycleOwner receiver,
    Function0<R> block
)

Run block with this LifecycleOwner's Lifecycle in a Lifecycle.State of at least Lifecycle.State.CREATED and resume with the result. Throws the CancellationException if the lifecycle has reached Lifecycle.State.DESTROYED by the time of the call or before block is able to run.

WithLifecycleStateKt.withResumed

public static final @NonNull R <R extends Object> WithLifecycleStateKt.withResumed(
    Lifecycle receiver,
    Function0<R> block
)

Run block with this Lifecycle in a Lifecycle.State of at least Lifecycle.State.RESUMED and resume with the result. Throws the CancellationException if the lifecycle has reached Lifecycle.State.DESTROYED by the time of the call or before block is able to run.

WithLifecycleStateKt.withResumed

public static final @NonNull R <R extends Object> WithLifecycleStateKt.withResumed(
    LifecycleOwner receiver,
    Function0<R> block
)

Run block with this LifecycleOwner's Lifecycle in a Lifecycle.State of at least Lifecycle.State.RESUMED and resume with the result. Throws the CancellationException if the lifecycle has reached Lifecycle.State.DESTROYED by the time of the call or before block is able to run.

WithLifecycleStateKt.withStarted