blob: 2cfb2f5a7a6cba7ad3c9bec12e5a095ab04c57bd [file] [log] [blame]
package com.airbnb.lottie;
import org.json.JSONObject;
/**
* Data class describing an image asset exported by bodymovin.
*/
public class LottieImageAsset {
private final int width;
private final int height;
private final String id;
private final String fileName;
private LottieImageAsset(int width, int height, String id, String fileName) {
this.width = width;
this.height = height;
this.id = id;
this.fileName = fileName;
}
static class Factory {
private Factory() {
}
static LottieImageAsset newInstance(JSONObject imageJson) {
return new LottieImageAsset(imageJson.optInt("w"), imageJson.optInt("h"), imageJson.optString("id"),
imageJson.optString("p"));
}
}
public int getWidth() {
return width;
}
public int getHeight() {
return height;
}
public String getId() {
return id;
}
public String getFileName() {
return fileName;
}
}