-
- All Implemented Interfaces:
-
android.view.Choreographer.FrameCallback,java.lang.Cloneable
public class LottieValueAnimator extends BaseLottieAnimator implements Choreographer.FrameCallback
This is a slightly modified ValueAnimator that allows us to update start and end values easily optimizing for the fact that we know that it's a value animator with 2 floats.
-
-
Field Summary
Fields Modifier and Type Field Description private floatspeedprivate floatframeprivate floatminFrameprivate floatmaxFrameprivate LottieCompositioncompositionprivate booleanuseCompositionFrameRate
-
Constructor Summary
Constructors Constructor Description LottieValueAnimator()
-
Method Summary
Modifier and Type Method Description floatgetSpeed()Returns the current speed. voidsetSpeed(float speed)floatgetFrame()voidsetFrame(float frame)floatgetMinFrame()voidsetMinFrame(int minFrame)floatgetMaxFrame()voidsetMaxFrame(float maxFrame)voidsetComposition(LottieComposition composition)voidsetUseCompositionFrameRate(boolean useCompositionFrameRate)ObjectgetAnimatedValue()Returns a float representing the current value of the animation from 0 to 1regardless of the animation speed, direction, or min and max frames. floatgetAnimatedValueAbsolute()Returns the current value of the animation from 0 to 1 regardlessof the animation speed, direction, or min and max frames. floatgetAnimatedFraction()Returns the current value of the currently playing animation taking intoaccount direction, min and max frames. longgetDuration()booleanisRunning()voiddoFrame(long frameTimeNanos)voidclearComposition()voidsetMinAndMaxFrames(float minFrame, float maxFrame)voidreverseAnimationSpeed()voidsetRepeatMode(int value)voidplayAnimation()voidendAnimation()voidpauseAnimation()voidresumeAnimation()voidcancel()-
Methods inherited from class com.airbnb.lottie.utils.BaseLottieAnimator
addListener, addPauseListener, addUpdateListener, getStartDelay, removeAllListeners, removeAllUpdateListeners, removeListener, removePauseListener, removeUpdateListener, setDuration, setInterpolator, setStartDelay -
Methods inherited from class android.animation.ValueAnimator
addUpdateListener, areAnimatorsEnabled, cancel, clone, end, getAnimatedFraction, getAnimatedValue, getCurrentPlayTime, getDuration, getDurationScale, getFrameDelay, getInterpolator, getRepeatCount, getRepeatMode, getStartDelay, getTotalDuration, getValues, isRunning, isStarted, ofArgb, ofFloat, ofInt, ofObject, ofPropertyValuesHolder, pause, registerDurationScaleChangeListener, removeAllUpdateListeners, removeUpdateListener, resume, reverse, setCurrentFraction, setCurrentPlayTime, setDuration, setEvaluator, setFloatValues, setFrameDelay, setIntValues, setInterpolator, setObjectValues, setRepeatCount, setRepeatMode, setStartDelay, setValues, start, toString, unregisterDurationScaleChangeListener -
Methods inherited from class android.animation.Animator
addListener, addPauseListener, clone, getListeners, isPaused, removeAllListeners, removeListener, removePauseListener, setDuration, setTarget, setupEndValues, setupStartValues -
Methods inherited from class android.view.Choreographer.FrameCallback
doFrame -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getSpeed
float getSpeed()
Returns the current speed. This will be affected by repeat mode REVERSE.
-
setSpeed
void setSpeed(float speed)
-
getFrame
float getFrame()
-
setFrame
void setFrame(float frame)
-
getMinFrame
float getMinFrame()
-
setMinFrame
void setMinFrame(int minFrame)
-
getMaxFrame
float getMaxFrame()
-
setMaxFrame
void setMaxFrame(float maxFrame)
-
setComposition
void setComposition(LottieComposition composition)
-
setUseCompositionFrameRate
void setUseCompositionFrameRate(boolean useCompositionFrameRate)
-
getAnimatedValue
Object getAnimatedValue()
Returns a float representing the current value of the animation from 0 to 1regardless of the animation speed, direction, or min and max frames.
-
getAnimatedValueAbsolute
@FloatRange(from = 0f, to = 1f) float getAnimatedValueAbsolute()
Returns the current value of the animation from 0 to 1 regardlessof the animation speed, direction, or min and max frames.
-
getAnimatedFraction
@FloatRange(from = 0f, to = 1f) float getAnimatedFraction()
Returns the current value of the currently playing animation taking intoaccount direction, min and max frames.
-
getDuration
long getDuration()
-
isRunning
boolean isRunning()
-
doFrame
void doFrame(long frameTimeNanos)
-
clearComposition
void clearComposition()
-
setMinAndMaxFrames
void setMinAndMaxFrames(float minFrame, float maxFrame)
-
reverseAnimationSpeed
void reverseAnimationSpeed()
-
setRepeatMode
void setRepeatMode(int value)
-
playAnimation
@MainThread() void playAnimation()
-
endAnimation
@MainThread() void endAnimation()
-
pauseAnimation
@MainThread() void pauseAnimation()
-
resumeAnimation
@MainThread() void resumeAnimation()
-
cancel
@MainThread() void cancel()
-
-
-
-