Search in sources :

Example 1 with CircleShape

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

the class CircleShapeParser method parse.

static CircleShape parse(JsonReader reader, LottieComposition composition, int d) throws IOException {
    String name = null;
    AnimatableValue<PointF, PointF> position = null;
    AnimatablePointValue size = null;
    boolean reversed = d == 3;
    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:
                hidden = reader.nextBoolean();
                break;
            case 4:
                // "d" is 2 for normal and 3 for reversed.
                reversed = reader.nextInt() == 3;
                break;
            default:
                reader.skipName();
                reader.skipValue();
        }
    }
    return new CircleShape(name, position, size, reversed, hidden);
}
Also used : AnimatablePointValue(com.airbnb.lottie.model.animatable.AnimatablePointValue) CircleShape(com.airbnb.lottie.model.content.CircleShape) PointF(android.graphics.PointF)

Aggregations

PointF (android.graphics.PointF)1 AnimatablePointValue (com.airbnb.lottie.model.animatable.AnimatablePointValue)1 CircleShape (com.airbnb.lottie.model.content.CircleShape)1