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


sealed class BaseAnimationClock : AnimationClockObservable
   ↳ androidx.animation.BaseAnimationClock

Base implementation for the AnimationClockObservable that handles the subscribing and unsubscribing logic that would be common for all custom animation clocks.


Public methods

open Unit

Subscribes observer to this clock.

open Unit

Unsubscribes an observer from the animation clock.

Inherited extension functions

From androidx.ui.animation

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 methods


open fun subscribe(observer: AnimationClockObserver): Unit

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


open fun unsubscribe(observer: AnimationClockObserver): Unit

Unsubscribes an observer from the animation clock.

Observers may only be added to a clock once. If subscribe has been called multiple times with the same observer, a single call to this method will unregister the observer completely.

observer: AnimationClockObserver The observer to be removed from the subscription list.