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

ManualAnimationClock

class ManualAnimationClock : BaseAnimationClock
kotlin.Any
   ↳ androidx.animation.BaseAnimationClock
   ↳ androidx.animation.ManualAnimationClock

A custom clock whose frame time can be manually updated via mutating clockTimeMillis.

Summary

Public constructors

<init>(initTimeMillis: Long)

A custom clock whose frame time can be manually updated via mutating clockTimeMillis.

Public methods

Unit

Subscribes observer to this clock.

Inherited functions

Inherited extension functions

From androidx.compose
operator T

IMPORTANT: This global operator is TEMPORARY, and should be removed whenever an answer for contextual composers is reached.

Properties

Long

Clock time in milliseconds.

Public constructors

<init>

ManualAnimationClock(initTimeMillis: Long)

A custom clock whose frame time can be manually updated via mutating clockTimeMillis.

Public methods

subscribe

fun subscribe(observer: AnimationClockObserver): Unit

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

Properties

clockTimeMillis

var clockTimeMillis: Long

Clock time in milliseconds. When clockTimeMillis is updated, the ManualAnimationClock notifies all its observers (i.e. animations) the new clock time. The animations will consequently snap to the new play time.