Package androidx.compose.runtime.dispatch

Types

AndroidUiDispatcher
Link copied to clipboard
class AndroidUiDispatcher : CoroutineDispatcher
A CoroutineDispatcher that will perform dispatch during a handler callback or choreographer's animation frame stage, whichever comes first.
AndroidUiFrameClock
Link copied to clipboard
class AndroidUiFrameClock(choreographer: Choreographer)
BroadcastFrameClock
Link copied to clipboard
common
class BroadcastFrameClock(onNewAwaiters: () -> Unit?) : MonotonicFrameClock
A simple frame clock.
MonotonicFrameClock
Link copied to clipboard
common
interface MonotonicFrameClock : CoroutineContext.Element
Provides a time source for display frames and the ability to perform an action on the next frame.

Functions

withFrameMillis
Link copied to clipboard
common
suspend fun <R> withFrameMillis(onFrame: (frameTimeMillis: Long) -> R): R
Suspends until a new frame is requested, immediately invokes onFrame with the frame time in nanoseconds in the calling context of frame dispatch, then resumes with the result from onFrame.
inline suspend fun <R> MonotonicFrameClock.withFrameMillis(crossinline onFrame: (frameTimeMillis: Long) -> R): R
Suspends until a new frame is requested, immediately invokes onFrame with the frame time in nanoseconds in the calling context of frame dispatch, then resumes with the result from onFrame.
withFrameNanos
Link copied to clipboard
common
suspend fun <R> withFrameNanos(onFrame: (frameTimeMillis: Long) -> R): R
Suspends until a new frame is requested, immediately invokes onFrame with the frame time in nanoseconds in the calling context of frame dispatch, then resumes with the result from onFrame.

Properties

DefaultMonotonicFrameClock
Link copied to clipboard
common
val DefaultMonotonicFrameClock: MonotonicFrameClock
DefaultMonotonicFrameClock
Link copied to clipboard
common
val DefaultMonotonicFrameClock: MonotonicFrameClock
The MonotonicFrameClock used by withFrameNanos and withFrameMillis if one is not present in the calling kotlin.coroutines.CoroutineContext.