/
LottieShapeTrimPath.java
34 lines (27 loc) · 1.09 KB
/
LottieShapeTrimPath.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.airbnb.lottie.model;
import com.airbnb.lottie.animation.LottieAnimatableFloatValue;
import org.json.JSONException;
import org.json.JSONObject;
public class LottieShapeTrimPath {
private LottieAnimatableFloatValue start;
private LottieAnimatableFloatValue end;
private LottieAnimatableFloatValue offset;
public LottieShapeTrimPath(JSONObject json, int frameRate, long compDuration) {
try {
start = new LottieAnimatableFloatValue(json.getJSONObject("s"), frameRate, compDuration);
end = new LottieAnimatableFloatValue(json.getJSONObject("e"), frameRate, compDuration);
offset = new LottieAnimatableFloatValue(json.getJSONObject("o"), frameRate, compDuration);
} catch (JSONException e) {
throw new IllegalArgumentException("Unable to parse trim path " + json, e);
}
}
public LottieAnimatableFloatValue getEnd() {
return end;
}
public LottieAnimatableFloatValue getOffset() {
return offset;
}
public LottieAnimatableFloatValue getStart() {
return start;
}
}