Class BaseKeyframeAnimation<K,A>
- java.lang.Object
-
- com.airbnb.lottie.animation.keyframe.BaseKeyframeAnimation<K,A>
-
- Type Parameters:
K- Keyframe typeA- Animation type
- Direct Known Subclasses:
ColorKeyframeAnimation,FloatKeyframeAnimation,GradientColorKeyframeAnimation,IntegerKeyframeAnimation,PathKeyframeAnimation,PointKeyframeAnimation,ScaleKeyframeAnimation,ShapeKeyframeAnimation,SplitDimensionPathKeyframeAnimation,TextKeyframeAnimation,ValueCallbackKeyframeAnimation
public abstract class BaseKeyframeAnimation<K,A> extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceBaseKeyframeAnimation.AnimationListener
-
Field Summary
Fields Modifier and Type Field Description protected floatprogressprotected LottieValueCallback<A>valueCallback
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddUpdateListener(BaseKeyframeAnimation.AnimationListener listener)protected Keyframe<K>getCurrentKeyframe()protected floatgetInterpolatedCurrentKeyframeProgress()Takes the value ofgetLinearCurrentKeyframeProgress()and interpolates it with the current keyframe's interpolator.floatgetProgress()AgetValue()protected AgetValue(Keyframe<K> keyframe, float linearKeyframeProgress, float xKeyframeProgress, float yKeyframeProgress)Similar togetValue(Keyframe, float)but used when an animation has separate interpolators for the X and Y axis.voidnotifyListeners()voidsetIsDiscrete()voidsetProgress(float progress)voidsetValueCallback(LottieValueCallback<A> valueCallback)
-
-
-
Field Detail
-
progress
protected float progress
-
valueCallback
@Nullable protected LottieValueCallback<A> valueCallback
-
-
Method Detail
-
setIsDiscrete
public void setIsDiscrete()
-
addUpdateListener
public void addUpdateListener(BaseKeyframeAnimation.AnimationListener listener)
-
setProgress
public void setProgress(@FloatRange(from=0.0,to=1.0) float progress)
-
notifyListeners
public void notifyListeners()
-
getInterpolatedCurrentKeyframeProgress
protected float getInterpolatedCurrentKeyframeProgress()
Takes the value ofgetLinearCurrentKeyframeProgress()and interpolates it with the current keyframe's interpolator.
-
getValue
public A getValue()
-
getProgress
public float getProgress()
-
setValueCallback
public void setValueCallback(@Nullable LottieValueCallback<A> valueCallback)
-
getValue
protected A getValue(Keyframe<K> keyframe, float linearKeyframeProgress, float xKeyframeProgress, float yKeyframeProgress)
Similar togetValue(Keyframe, float)but used when an animation has separate interpolators for the X and Y axis.
-
-