Interface IAnimator
interface IAnimator
Extends com.amazon.apmf.IStandard
Interface for controlling an animation.
Methods
isAnimating()
bool isAnimating()
Checks if the animation is in progress.
Returns
bool
True if animating, false otherwise.
start()
void start()
Starts the animation from the start value or the reset value.
It invokes IAnimatorListener::onStart for all listeners.
resume()
void resume()
Resumes the animation.
Resumes a paused animation, causing the animator to pick up where it left off
when it was paused. Calls to resume() on IAnimator that is
not currently paused will be ignored. It invokes IAnimatorListener::onResume for all listeners.
pause()
void pause()
Pauses the animation.
Pauses a running animation. Paused animations can be resumed by calling resume().
It invokes IAnimatorListener::onPause for all listeners.
cancel()
void cancel()
Cancels the animation.
It stops the animation in between, and invokes IAnimatorListener::onCancel
method of its listeners, followed by IAnimatorListener::onEnd.
reset()
Resets the animation to the specified value, which represents a fraction of the total duration. Stops an animation and resets the state of the animator.voidreset(floatvalue)
Parameters
value
float — Required
A value to reset to. The animation’s current position
will be updated to the specified value. The value must be in the range 0.0 to 1.0,
representing a fraction of the total duration. If 0, the animation
will reset to the start value of the animation.
reverse()
Plays the IAnimator in reverse direction to a value representing the elapsed fraction of an animation duration. If the animation is already running, it will stop and reverse its direction, playing backwards from the current position. If the animation is not currently running, it will start from the end value and play backwards towards the specified ‘to’ value. This reverse behavior is applied only for the current animation cycle. Future calls to start the animation will use the default forward direction unlessvoidreverse(floatto)
reverse() is called again.
Parameters
to
float — Required
A target value to animate towards when reversing the direction.
The animation will travel from its current position to the specified to value. The
value must be in the range 0.0 to 1.0, representing a fraction of the total duration.
forward()
Starts an animation forward to a specified value. representing the elapsed fraction of an animation duration. This method advances the animation and starts running from the specified target value towards the end value.voidforward(floatto)
Parameters
to
float — Required
The target value, the animation advances to. The value must be
in the range 0.0 to 1.0, representing a fraction of the total duration.
Note: The animation will start immediately after calling this method.
getElapsedDuration()
com.amazon.apmf.MonotonicDuration getElapsedDuration()
This method returns the elapsed duration of the animation.
This method returns the amount of time that has elapsed since the animation started playing.
If the animation is not currently running or has not been started yet,
it will return a duration of zero.
Returns
com.amazon.apmf.MonotonicDuration
The elapsed duration of the animation in MonotonicDuration.
getCurrentAnimationValue()
Returns the most recent value calculated by this IAnimator. It is commonly used to retrieve the current animation value during theIAnimationValue?getCurrentAnimationValue()
IAnimatorListener::onUpdate callback, which is invoked for each new frame of the animation.
Returns
IAnimationValue?
The return value is optional and might be absent.
The IAnimationValue value most recently calculated by this IAnimator.
If animation is not running, returned value is NULL.
addAnimationListener()
Adds a listener for animation events.com.amazon.apmf.ISubscription*addAnimationListener(IAnimatorListener*listener)
Parameters
listener
IAnimatorListener* — Required
The listener to add.
Returns
com.amazon.apmf.ISubscription*
An ISubscription object that can be used to remove the listener.

