Package kotlinx.coroutines.android

Provides Dispatchers.Main context for Android applications.

Types

HandlerDispatcher
Link copied to clipboard
sealed class HandlerDispatcher : MainCoroutineDispatcher, Delay

Dispatches execution onto Android Handler.

Functions

asCoroutineDispatcher
Link copied to clipboard
@JvmName(name = "from")
fun Handler.asCoroutineDispatcher(name: String? = null): HandlerDispatcher

Represents an arbitrary Handler as an implementation of CoroutineDispatcher with an optional name for nicer debugging

awaitFrame
Link copied to clipboard
suspend fun awaitFrame(): Long

Awaits the next animation frame and returns frame time in nanoseconds.