Search in sources :

Example 1 with ShapeTrimPath

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

the class ShapeTrimPathParser method parse.

static ShapeTrimPath parse(JsonReader reader, LottieComposition composition) throws IOException {
    String name = null;
    ShapeTrimPath.Type type = null;
    AnimatableFloatValue start = null;
    AnimatableFloatValue end = null;
    AnimatableFloatValue offset = null;
    boolean hidden = false;
    while (reader.hasNext()) {
        switch(reader.selectName(NAMES)) {
            case 0:
                start = AnimatableValueParser.parseFloat(reader, composition, false);
                break;
            case 1:
                end = AnimatableValueParser.parseFloat(reader, composition, false);
                break;
            case 2:
                offset = AnimatableValueParser.parseFloat(reader, composition, false);
                break;
            case 3:
                name = reader.nextString();
                break;
            case 4:
                type = ShapeTrimPath.Type.forId(reader.nextInt());
                break;
            case 5:
                hidden = reader.nextBoolean();
                break;
            default:
                reader.skipValue();
        }
    }
    return new ShapeTrimPath(name, type, start, end, offset, hidden);
}
Also used : ShapeTrimPath(com.airbnb.lottie.model.content.ShapeTrimPath) AnimatableFloatValue(com.airbnb.lottie.model.animatable.AnimatableFloatValue)

Aggregations

AnimatableFloatValue (com.airbnb.lottie.model.animatable.AnimatableFloatValue)1 ShapeTrimPath (com.airbnb.lottie.model.content.ShapeTrimPath)1