TimeAnimator
open class TimeAnimator : ValueAnimator
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 |
|
From class ValueAnimator
Int |
INFINITE
This value used used with the setRepeatCount(int) property to repeat the animation indefinitely.
|
Int |
RESTART
When the animation reaches the end and repeatCount is INFINITE or a positive value, the animation restarts from the beginning.
|
Int |
REVERSE
When the animation reaches the end and repeatCount is INFINITE or a positive value, the animation reverses direction on every iteration.
|
|
Public constructors |
This class provides a simple callback mechanism to listeners that is synchronized with all other animators in the system.
|
Public methods |
open Unit |
|
open Unit |
Sets a listener that is sent update events throughout the life of an animation.
|
open Unit |
|
Inherited functions |
From class Animator
Unit |
addListener(@NonNull listener: Animator.AnimatorListener)
Adds a listener to the set of listeners that are sent events through the life of an animation, such as start, repeat, and end.
|
Unit |
addPauseListener(@NonNull listener: Animator.AnimatorPauseListener)
Adds a pause listener to this animator.
|
Unit |
addUpdateListener(@NonNull listener: Animator.AnimatorUpdateListener)
Adds a listener to the set of listeners that are sent update events through the life of an animation. This method is called on all listeners for every frame of the animation, after the values for the animation have been calculated.
|
Boolean |
isPaused()
Returns whether this animator is currently in a paused state.
|
Unit |
removeAllListeners()
Removes all listeners and pauseListeners from this object.
|
Unit |
removeAllUpdateListeners()
Removes all listeners from the set listening to frame updates for this animation.
|
Unit |
removeListener(@NonNull listener: Animator.AnimatorListener)
Removes a listener from the set listening to this animation.
|
Unit |
removePauseListener(@NonNull listener: Animator.AnimatorPauseListener)
Removes a pause listener from the set listening to this animation.
|
Unit |
removeUpdateListener(@NonNull listener: Animator.AnimatorUpdateListener)
Removes a listener from the set listening to frame updates for this animation.
|
Unit |
setTarget(@Nullable target: Any?)
Sets the target object whose property will be animated by this animation. Not all subclasses operate on target objects (for example, ValueAnimator , but this method is on the superclass for the convenience of dealing generically with those subclasses that do handle targets.
Note: The target is stored as a weak reference internally to avoid leaking resources by having animators directly reference old targets. Therefore, you should ensure that animator targets always have a hard reference elsewhere.
|
Unit |
setupEndValues()
This method tells the object to use appropriate information to extract ending values for the animation. For example, a AnimatorSet object will pass this call to its child objects to tell them to set up the values. A ObjectAnimator object will use the information it has about its target object and PropertyValuesHolder objects to get the start values for its properties. A ValueAnimator object will ignore the request since it does not have enough information (such as a target object) to gather these values.
|
Unit |
setupStartValues()
This method tells the object to use appropriate information to extract starting values for the animation. For example, a AnimatorSet object will pass this call to its child objects to tell them to set up the values. A ObjectAnimator object will use the information it has about its target object and PropertyValuesHolder objects to get the start values for its properties. A ValueAnimator object will ignore the request since it does not have enough information (such as a target object) to gather these values.
|
|
From class ValueAnimator
Boolean |
areAnimatorsEnabled()
Returns whether animators are currently enabled, system-wide. By default, all animators are enabled. This can change if either the user sets a Developer Option to set the animator duration scale to 0 or by Battery Savery mode being enabled (which disables all animations).
Developers should not typically need to call this method, but should an app wish to show a different experience when animators are disabled, | |