InfiniteAnimationPolicy

Provides a policy that will be applied to animations that get their frame time from withInfiniteAnimationFrameNanos or withInfiniteAnimationFrameMillis This can be used to intervene in infinite animations to make them finite, for example by cancelling such coroutines.

Types

Link copied to clipboard

Properties

Link copied to clipboard
open override val key: CoroutineContext.Key<*>

Functions

Link copied to clipboard
open override fun <R> fold(initial: R, operation: (R, CoroutineContext.Element) -> R): R
Link copied to clipboard
open operator override fun <E : CoroutineContext.Element> get(key: CoroutineContext.Key<E>): E?
Link copied to clipboard
open override fun minusKey(key: CoroutineContext.Key<*>): CoroutineContext
Link copied to clipboard
abstract suspend fun <R> onInfiniteOperation(block: suspend () -> R): R

Call this to apply the policy on the given suspending block. Execution of the block is determined by the policy implementation. For example, a test policy could decide not to run the block, or trace its execution.

Link copied to clipboard
open operator fun plus(context: CoroutineContext): CoroutineContext