use of com.airbnb.lottie.model.animatable.AnimatableShapeValue in project lottie-android by airbnb.
the class MaskParser method parse.
static Mask parse(JsonReader reader, LottieComposition composition) throws IOException {
Mask.MaskMode maskMode = null;
AnimatableShapeValue maskPath = null;
AnimatableIntegerValue opacity = null;
boolean inverted = false;
reader.beginObject();
while (reader.hasNext()) {
String mode = reader.nextName();
switch(mode) {
case "mode":
switch(reader.nextString()) {
case "a":
maskMode = Mask.MaskMode.MASK_MODE_ADD;
break;
case "s":
maskMode = Mask.MaskMode.MASK_MODE_SUBTRACT;
break;
case "n":
maskMode = Mask.MaskMode.MASK_MODE_NONE;
break;
case "i":
composition.addWarning("Animation contains intersect masks. They are not supported but will be treated like add masks.");
maskMode = Mask.MaskMode.MASK_MODE_INTERSECT;
break;
default:
Logger.warning("Unknown mask mode " + mode + ". Defaulting to Add.");
maskMode = Mask.MaskMode.MASK_MODE_ADD;
}
break;
case "pt":
maskPath = AnimatableValueParser.parseShapeData(reader, composition);
break;
case "o":
opacity = AnimatableValueParser.parseInteger(reader, composition);
break;
case "inv":
inverted = reader.nextBoolean();
break;
default:
reader.skipValue();
}
}
reader.endObject();
return new Mask(maskMode, maskPath, opacity, inverted);
}
use of com.airbnb.lottie.model.animatable.AnimatableShapeValue in project lottie-android by airbnb.
the class ShapePathParser method parse.
static ShapePath parse(JsonReader reader, LottieComposition composition) throws IOException {
String name = null;
int ind = 0;
AnimatableShapeValue shape = null;
boolean hidden = false;
while (reader.hasNext()) {
switch(reader.selectName(NAMES)) {
case 0:
name = reader.nextString();
break;
case 1:
ind = reader.nextInt();
break;
case 2:
shape = AnimatableValueParser.parseShapeData(reader, composition);
break;
case 3:
hidden = reader.nextBoolean();
break;
default:
reader.skipValue();
}
}
return new ShapePath(name, ind, shape, hidden);
}
Aggregations