Added in API level 16

TimeAnimator


open class TimeAnimator : ValueAnimator
kotlin.Any
   ↳ android.animation.Animator
   ↳ android.animation.ValueAnimator
   ↳ android.animation.TimeAnimator

This class provides a simple callback mechanism to listeners that is synchronized with all other animators in the system. There is no duration, interpolation, or object value-setting with this Animator. Instead, it is simply started, after which it proceeds to send out events on every animation frame to its TimeListener (if set), with information about this animator, the total elapsed time, and the elapsed time since the previous animation frame.

Summary

Nested classes
abstract

Implementors of this interface can set themselves as update listeners to a TimeAnimator instance to receive callbacks on every animation frame to receive the total time since the animator started and the delta time since the last frame.

Inherited constants
Public constructors

Public methods
open Unit

open Unit

Sets a listener that is sent update events throughout the life of an animation.

open Unit

Inherited functions

Public constructors

TimeAnimator

TimeAnimator()

Public methods

setCurrentPlayTime

Added in API level 16
open fun setCurrentPlayTime(playTime: Long): Unit
Parameters
playTime Long: The time, in milliseconds, to which the animation is advanced or rewound.

setTimeListener

Added in API level 16
open fun setTimeListener(listener: TimeAnimator.TimeListener!): Unit

Sets a listener that is sent update events throughout the life of an animation.

Parameters
listener TimeAnimator.TimeListener!: the listener to be set.

start

Added in API level 16
open fun start(): Unit