• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package com.airbnb.lottie.value;
2 
3 import androidx.annotation.RestrictTo;
4 
5 /**
6  * Data class for use with {@link LottieValueCallback}.
7  * You should *not* hold a reference to the frame info parameter passed to your callback. It will be reused.
8  */
9 public class LottieFrameInfo<T> {
10   private float startFrame;
11   private float endFrame;
12   private T startValue;
13   private T endValue;
14   private float linearKeyframeProgress;
15   private float interpolatedKeyframeProgress;
16   private float overallProgress;
17 
18   @RestrictTo(RestrictTo.Scope.LIBRARY)
set( float startFrame, float endFrame, T startValue, T endValue, float linearKeyframeProgress, float interpolatedKeyframeProgress, float overallProgress )19   public LottieFrameInfo<T> set(
20       float startFrame,
21       float endFrame,
22       T startValue,
23       T endValue,
24       float linearKeyframeProgress,
25       float interpolatedKeyframeProgress,
26       float overallProgress
27   ) {
28     this.startFrame = startFrame;
29     this.endFrame = endFrame;
30     this.startValue = startValue;
31     this.endValue = endValue;
32     this.linearKeyframeProgress = linearKeyframeProgress;
33     this.interpolatedKeyframeProgress = interpolatedKeyframeProgress;
34     this.overallProgress = overallProgress;
35     return this;
36   }
37 
getStartFrame()38   public float getStartFrame() {
39     return startFrame;
40   }
41 
getEndFrame()42   public float getEndFrame() {
43     return endFrame;
44   }
45 
getStartValue()46   public T getStartValue() {
47     return startValue;
48   }
49 
getEndValue()50   public T getEndValue() {
51     return endValue;
52   }
53 
getLinearKeyframeProgress()54   public float getLinearKeyframeProgress() {
55     return linearKeyframeProgress;
56   }
57 
getInterpolatedKeyframeProgress()58   public float getInterpolatedKeyframeProgress() {
59     return interpolatedKeyframeProgress;
60   }
61 
getOverallProgress()62   public float getOverallProgress() {
63     return overallProgress;
64   }
65 }
66