blob: 37be5cb937fae3187acf42695a0b321a8f1bba92 [file] [log] [blame]
package com.airbnb.lottie.animation.keyframe;
import com.airbnb.lottie.animation.Keyframe;
import com.airbnb.lottie.utils.MiscUtils;
import java.util.List;
public class IntegerKeyframeAnimation extends KeyframeAnimation<Integer> {
public IntegerKeyframeAnimation(List<Keyframe<Integer>> keyframes) {
super(keyframes);
}
@Override Integer getValue(Keyframe<Integer> keyframe, float keyframeProgress) {
if (keyframe.startValue == null || keyframe.endValue == null) {
throw new IllegalStateException("Missing values for keyframe.");
}
if (valueCallback != null) {
//noinspection ConstantConditions
return valueCallback.getValueInternal(keyframe.startFrame, keyframe.endFrame,
keyframe.startValue, keyframe.endValue,
keyframeProgress, getLinearCurrentKeyframeProgress(), getProgress());
}
return MiscUtils.lerp(keyframe.startValue, keyframe.endValue, keyframeProgress);
}
}