AnimationClockObservable

interface AnimationClockObservable
androidx.animation.AnimationClockObservable

This interface allows AnimationClock to be subscribed and unsubscribed.

Summary

Public methods

abstract Unit

Subscribes an observer to the animation clock source.

abstract Unit

Unsubscribes an observer from the animation clock.

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 methods

subscribe

abstract fun subscribe(observer: AnimationClockObserver): Unit

Subscribes an observer to the animation clock source.

Observers may only be added to a clock once. Calls to add the same observer more than once will be ignored, and a single call to unsubscribe will unregister from further callbacks.

Parameters
observer: AnimationClockObserver The observer that will be notified when animation clock time is updated.

unsubscribe

abstract 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.

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