The second Android 11 Developer Preview is now available, test it out and share your feedback.

DefaultAnimationClock

class DefaultAnimationClock : BaseAnimationClock
kotlin.Any
   ↳ androidx.animation.BaseAnimationClock
   ↳ androidx.animation.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.ui.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.