Search in sources :

Example 1 with RectangleShape

use of com.airbnb.lottie.model.content.RectangleShape in project lottie-android by airbnb.

the class RectangleShapeParser method parse.

static RectangleShape parse(JsonReader reader, LottieComposition composition) throws IOException {
    String name = null;
    AnimatableValue<PointF, PointF> position = null;
    AnimatableValue<PointF, PointF> size = null;
    AnimatableFloatValue roundedness = null;
    boolean hidden = false;
    while (reader.hasNext()) {
        switch(reader.selectName(NAMES)) {
            case 0:
                name = reader.nextString();
                break;
            case 1:
                position = AnimatablePathValueParser.parseSplitPath(reader, composition);
                break;
            case 2:
                size = AnimatableValueParser.parsePoint(reader, composition);
                break;
            case 3:
                roundedness = AnimatableValueParser.parseFloat(reader, composition);
                break;
            case 4:
                hidden = reader.nextBoolean();
                break;
            default:
                reader.skipValue();
        }
    }
    return new RectangleShape(name, position, size, roundedness, hidden);
}
Also used : RectangleShape(com.airbnb.lottie.model.content.RectangleShape) PointF(android.graphics.PointF) AnimatableFloatValue(com.airbnb.lottie.model.animatable.AnimatableFloatValue)

Aggregations

PointF (android.graphics.PointF)1 AnimatableFloatValue (com.airbnb.lottie.model.animatable.AnimatableFloatValue)1 RectangleShape (com.airbnb.lottie.model.content.RectangleShape)1