{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

AndroidUiDispatcher

public final class AndroidUiDispatcher extends CoroutineDispatcher

java.lang.Object
   ↳ kotlin.coroutines.AbstractCoroutineContextElement
     ↳ kotlinx.coroutines.CoroutineDispatcher
       ↳ androidx.compose.ui.platform.AndroidUiDispatcher

A CoroutineDispatcher that will perform dispatch during a handler callback or choreographer's animation frame stage, whichever comes first. Use Main to obtain a dispatcher for the process's main thread (i.e. the activity thread) or CurrentThread to obtain a dispatcher for the current thread.

Summary

Nested types

public static class AndroidUiDispatcher.Companion

Public methods

void
final @NonNull Choreographer
final @NonNull MonotonicFrameClock

A MonotonicFrameClock associated with this AndroidUiDispatcher's choreographer that may be used to await Choreographer frame dispatch.

Inherited methods

From kotlin.coroutines.AbstractCoroutineContextElement
From kotlin.coroutines.CoroutineContext
From kotlin.coroutines.CoroutineContext.Element
@NonNull R
<R extends Object> fold(
    @NonNull R initial,
    @NonNull Function2<@NonNull R, @NonNull CoroutineContext.Element, @NonNull R> operation
)
E
@NonNull CoroutineContext
From kotlinx.coroutines.CoroutineDispatcher
void
final @NonNull Continuation<@NonNull T>
<T extends Object> interceptContinuation(
    @NonNull Continuation<@NonNull T> continuation
)
boolean
@NonNull CoroutineDispatcher
final @NonNull CoroutineDispatcher

This method is deprecated. Operator '+' on two CoroutineDispatcher objects is meaningless.

final void
@NonNull String

Public methods

dispatch

public void dispatch(@NonNull CoroutineContext context, @NonNull Runnable block)

getChoreographer

public final @NonNull Choreographer getChoreographer()

getFrameClock

public final @NonNull MonotonicFrameClock getFrameClock()

A MonotonicFrameClock associated with this AndroidUiDispatcher's choreographer that may be used to await Choreographer frame dispatch.