Skip to content

Commit

Permalink
Made a few getters on LottieComposition public
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Peal committed Feb 20, 2017
1 parent a89288a commit 7190023
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions lottie/src/main/java/com/airbnb/lottie/LottieComposition.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,6 @@ static LottieComposition fromJsonSync(Resources res, JSONObject json) {
Layer layer = new Layer(layersJson.optJSONObject(j), composition);
layerMap.put(layer.getId(), layer);
layers.add(layer);
if (!layer.getMasks().isEmpty()) {
composition.hasMasks = true;
}
if (layer.getMatteType() != null && layer.getMatteType() != Layer.MatteType.None) {
composition.hasMattes = true;
}
}
String id = precomp.optString("id");
composition.precomps.put(id, layers);
Expand All @@ -170,12 +164,6 @@ static LottieComposition fromJsonSync(Resources res, JSONObject json) {
private static void addLayer(LottieComposition composition, Layer layer) {
composition.layers.add(layer);
composition.layerMap.put(layer.getId(), layer);
if (!layer.getMasks().isEmpty()) {
composition.hasMasks = true;
}
if (layer.getMatteType() != null && layer.getMatteType() != Layer.MatteType.None) {
composition.hasMattes = true;
}
}

private final Map<String, List<Layer>> precomps = new HashMap<>();
Expand All @@ -185,8 +173,6 @@ private static void addLayer(LottieComposition composition, Layer layer) {
private long startFrame;
private long endFrame;
private int frameRate;
private boolean hasMasks;
private boolean hasMattes;
private float scale;

private LottieComposition(Resources res) {
Expand All @@ -198,11 +184,11 @@ Layer layerModelForId(long id) {
return layerMap.get(id);
}

Rect getBounds() {
@SuppressWarnings("WeakerAccess") public Rect getBounds() {
return bounds;
}

long getDuration() {
@SuppressWarnings("WeakerAccess") public long getDuration() {
long frameDuration = endFrame - startFrame;
return (long) (frameDuration / (float) frameRate * 1000);
}
Expand All @@ -225,15 +211,7 @@ float getDurationFrames() {
}


boolean hasMasks() {
return hasMasks;
}

boolean hasMattes() {
return hasMattes;
}

float getScale() {
public float getScale() {
return scale;
}

Expand Down

0 comments on commit 7190023

Please sign in to comment.