use of com.airbnb.lottie.model.content.ShapeGroup in project lottie-android by airbnb.
the class TextLayer method getContentsForCharacter.
private List<ContentGroup> getContentsForCharacter(FontCharacter character) {
if (contentsForCharacter.containsKey(character)) {
return contentsForCharacter.get(character);
}
List<ShapeGroup> shapes = character.getShapes();
int size = shapes.size();
List<ContentGroup> contents = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
ShapeGroup sg = shapes.get(i);
contents.add(new ContentGroup(lottieDrawable, this, sg));
}
contentsForCharacter.put(character, contents);
return contents;
}
use of com.airbnb.lottie.model.content.ShapeGroup in project lottie-android by airbnb.
the class ShapeGroupParser method parse.
static ShapeGroup parse(JsonReader reader, LottieComposition composition) throws IOException {
String name = null;
boolean hidden = false;
List<ContentModel> items = new ArrayList<>();
while (reader.hasNext()) {
switch(reader.selectName(NAMES)) {
case 0:
name = reader.nextString();
break;
case 1:
hidden = reader.nextBoolean();
break;
case 2:
reader.beginArray();
while (reader.hasNext()) {
ContentModel newItem = ContentModelParser.parse(reader, composition);
if (newItem != null) {
items.add(newItem);
}
}
reader.endArray();
break;
default:
reader.skipValue();
}
}
return new ShapeGroup(name, items, hidden);
}
Aggregations