Google is committed to advancing racial equity for Black communities. See how.

DefaultAnimationClock

actual class DefaultAnimationClock : BaseAnimationClock
kotlin.Any
   ↳ androidx.compose.animation.core.BaseAnimationClock
   ↳ androidx.compose.animation.core.DefaultAnimationClock

Default Choreographer based clock that pushes a new frame to all subscribers on each Choreographer tick, until all subscribers have unsubscribed. An instance of this clock will be provided through AnimationClockAmbient at the root of the composition tree.

If initialized from any other thread but the main thread, part of the initialization is done synchronously on the main thread. If this poses a problem, consider initializing this clock on the main thread itself.

Summary

Public constructors

Default Choreographer based clock that pushes a new frame to all subscribers on each Choreographer tick, until all subscribers have unsubscribed.

Public methods
Unit

Subscribes observer to this clock.

Inherited functions
Inherited extension functions
From androidx.compose.animation
DisposableAnimationClock

Return a new AnimationClockObservable wrapping this one that will auto-unsubscribe all AnimationClockObservers when this call leaves the composition, preventing clock subscriptions from persisting beyond the composition lifecycle.

Public constructors

<init>

DefaultAnimationClock()

Default Choreographer based clock that pushes a new frame to all subscribers on each Choreographer tick, until all subscribers have unsubscribed. An instance of this clock will be provided through AnimationClockAmbient at the root of the composition tree.

If initialized from any other thread but the main thread, part of the initialization is done synchronously on the main thread. If this poses a problem, consider initializing this clock on the main thread itself.

Public methods

subscribe

fun subscribe(observer: AnimationClockObserver): Unit

Subscribes observer to this clock. Duplicate subscriptions will be ignored.