| 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 = AnimatableShapeValue.Factory.newInstance(reader, composition); |
| break; |
| default: |
| reader.skipValue(); |
| } |
| } |
| |
| return new ShapePath(name, ind, shape); |
| } |
| } |