WithLifecycleStateKt

public final class WithLifecycleStateKt


Summary

Public methods

static final @NonNull R
<R extends Object> WithLifecycleStateKt.withCreated(
    @NonNull Lifecycle receiver,
    @NonNull Function0<@NonNull 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(
    @NonNull LifecycleOwner receiver,
    @NonNull Function0<@NonNull 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(
    @NonNull Lifecycle receiver,
    @NonNull Function0<@NonNull 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(
    @NonNull LifecycleOwner receiver,
    @NonNull Function0<@NonNull 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(
    @NonNull Lifecycle receiver,
    @NonNull Function0<@NonNull 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(
    @NonNull LifecycleOwner receiver,
    @NonNull Function0<@NonNull 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(
    @NonNull Lifecycle receiver,
    @NonNull Lifecycle.State state,
    @NonNull Function0<@NonNull 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(
    @NonNull LifecycleOwner receiver,
    @NonNull Lifecycle.State state,
    @NonNull Function0<@NonNull 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

@NonNull
public static final R <R extends Object> WithLifecycleStateKt.withCreated(
    @NonNull Lifecycle receiver,
    @NonNull Function0<@NonNull 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

@NonNull
public static final R <R extends Object> WithLifecycleStateKt.withCreated(
    @NonNull LifecycleOwner receiver,
    @NonNull Function0<@NonNull 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

@NonNull
public static final R <R extends Object> WithLifecycleStateKt.withResumed(
    @NonNull Lifecycle receiver,
    @NonNull Function0<@NonNull 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

@NonNull
public static final R <R extends Object> WithLifecycleStateKt.withResumed(
    @NonNull LifecycleOwner receiver,
    @NonNull Function0<@NonNull 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

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

Run block with this Lifecycle in a Lifecycle.State of at least Lifecycle.State.STARTED 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

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

Run block with this LifecycleOwner's Lifecycle in a Lifecycle.State of at least Lifecycle.State.STARTED 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.withStateAtLeast

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

Run block with this Lifecycle in a Lifecycle.State of at least state 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.withStateAtLeast

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

Run block with this LifecycleOwner's Lifecycle in a Lifecycle.State of at least state 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.