54 lines
2.3 KiB
Java
54 lines
2.3 KiB
Java
package com.airbnb.lottie.parser;
|
|
|
|
import android.graphics.Path;
|
|
import com.airbnb.deeplinkdispatch.base.MatchIndex;
|
|
import com.airbnb.lottie.LottieComposition;
|
|
import com.airbnb.lottie.model.animatable.AnimatableColorValue;
|
|
import com.airbnb.lottie.model.animatable.AnimatableIntegerValue;
|
|
import com.airbnb.lottie.model.content.ShapeFill;
|
|
import com.airbnb.lottie.parser.moshi.JsonReader;
|
|
import com.airbnb.lottie.value.Keyframe;
|
|
import java.io.IOException;
|
|
import java.util.Collections;
|
|
|
|
/* loaded from: classes.dex */
|
|
class ShapeFillParser {
|
|
private static final JsonReader.Options NAMES = JsonReader.Options.of("nm", "c", "o", "fillEnabled", MatchIndex.ROOT_VALUE, "hd");
|
|
|
|
private ShapeFillParser() {
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static ShapeFill parse(JsonReader jsonReader, LottieComposition lottieComposition) throws IOException {
|
|
AnimatableIntegerValue animatableIntegerValue = null;
|
|
String str = null;
|
|
AnimatableColorValue animatableColorValue = null;
|
|
boolean z = false;
|
|
boolean z2 = false;
|
|
int i = 1;
|
|
while (jsonReader.hasNext()) {
|
|
int selectName = jsonReader.selectName(NAMES);
|
|
if (selectName == 0) {
|
|
str = jsonReader.nextString();
|
|
} else if (selectName == 1) {
|
|
animatableColorValue = AnimatableValueParser.parseColor(jsonReader, lottieComposition);
|
|
} else if (selectName == 2) {
|
|
animatableIntegerValue = AnimatableValueParser.parseInteger(jsonReader, lottieComposition);
|
|
} else if (selectName == 3) {
|
|
z = jsonReader.nextBoolean();
|
|
} else if (selectName == 4) {
|
|
i = jsonReader.nextInt();
|
|
} else if (selectName == 5) {
|
|
z2 = jsonReader.nextBoolean();
|
|
} else {
|
|
jsonReader.skipName();
|
|
jsonReader.skipValue();
|
|
}
|
|
}
|
|
if (animatableIntegerValue == null) {
|
|
animatableIntegerValue = new AnimatableIntegerValue(Collections.singletonList(new Keyframe(100)));
|
|
}
|
|
return new ShapeFill(str, z, i == 1 ? Path.FillType.WINDING : Path.FillType.EVEN_ODD, animatableColorValue, animatableIntegerValue, z2);
|
|
}
|
|
}
|