blob: e3f7083da6446ef028393d9bb6ae9c14c6717924 [file] [log] [blame]
package com.airbnb.lottie.parser;
import android.util.JsonReader;
import com.airbnb.lottie.LottieComposition;
import com.airbnb.lottie.model.animatable.AnimatableShapeValue;
import com.airbnb.lottie.model.content.ShapePath;
import java.io.IOException;
public class ShapePathParser {
private ShapePathParser() {}
public static ShapePath parse(
JsonReader reader, LottieComposition composition) throws IOException {
String name = null;
int ind = 0;
AnimatableShapeValue shape = null;
while (reader.hasNext()) {
switch (reader.nextName()) {
case "nm":
name = reader.nextString();
break;
case "ind":
ind = reader.nextInt();
break;
case "ks":
shape = AnimatableValueParser.parseShapeData(reader, composition);
break;
default:
reader.skipValue();
}
}
return new ShapePath(name, ind, shape);
}
}