-
public class LottieValueCallback<T>Allows you to set a callback on a resolved com.airbnb.lottie.model.KeyPath to modify its animation values at runtime. If your dynamic property does the following, you must call invalidate or invalidateSelf each time you want to update this value. 1. Use SOFTWARE 2. Rendering a static image (the animation is either paused or there are no values changing within the animation itself) When using software rendering, Lottie caches the internal rendering bitmap. Whenever the animation changes internally, Lottie knows to invalidate the bitmap and re-render it on the next frame. If the animation never changes but your dynamic property does outside of Lottie, Lottie must be notified that it changed in order to set the bitmap as dirty and re-render it on the next frame.
-
-
Field Summary
Fields Modifier and Type Field Description private BaseKeyframeAnimation<out Object, out Object>animationprotected Tvalue
-
Constructor Summary
Constructors Constructor Description LottieValueCallback()LottieValueCallback(T staticValue)
-
Method Summary
Modifier and Type Method Description final voidsetAnimation(@Nullable() BaseKeyframeAnimation<out Object, out Object> animation)TgetValue(LottieFrameInfo<T> frameInfo)Override this if you haven't set a static value in the constructor or with setValue. TgetValue(LottieFrameInfo<T> frameInfo)Override this if you haven't set a static value in the constructor or with setValue. final TgetValueInternal(float startFrame, float endFrame, T startValue, T endValue, float linearKeyframeProgress, float interpolatedKeyframeProgress, float overallProgress)-
-
Method Detail
-
setAnimation
@RestrictTo(value = RestrictTo.Scope.LIBRARY) final void setAnimation(@Nullable() BaseKeyframeAnimation<out Object, out Object> animation)
-
getValue
@Nullable() T getValue(LottieFrameInfo<T> frameInfo)
Override this if you haven't set a static value in the constructor or with setValue.
Return null to resort to the default value.Refer to the javadoc for this class for a special case that requires manual invalidationeach time you want to return something different from this method.
-
getValue
@Nullable() T getValue(LottieFrameInfo<T> frameInfo)
Override this if you haven't set a static value in the constructor or with setValue.
Return null to resort to the default value.Refer to the javadoc for this class for a special case that requires manual invalidationeach time you want to return something different from this method.
-
getValueInternal
@RestrictTo(value = RestrictTo.Scope.LIBRARY)@Nullable() final T getValueInternal(float startFrame, float endFrame, T startValue, T endValue, float linearKeyframeProgress, float interpolatedKeyframeProgress, float overallProgress)
-
-
-
-