what-the-bank/sources/com/airbnb/lottie/parser/GradientFillParser.java

83 lines
3.8 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
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.AnimatableGradientColorValue;
import com.airbnb.lottie.model.animatable.AnimatableIntegerValue;
import com.airbnb.lottie.model.animatable.AnimatablePointValue;
import com.airbnb.lottie.model.content.GradientFill;
import com.airbnb.lottie.model.content.GradientType;
import com.airbnb.lottie.parser.moshi.JsonReader;
import com.airbnb.lottie.value.Keyframe;
import com.pingan.ai.p;
import java.io.IOException;
import java.util.Collections;
/* loaded from: classes.dex */
class GradientFillParser {
private static final JsonReader.Options NAMES = JsonReader.Options.of("nm", "g", "o", "t", "s", "e", MatchIndex.ROOT_VALUE, "hd");
private static final JsonReader.Options GRADIENT_NAMES = JsonReader.Options.of(p.a, "k");
private GradientFillParser() {
}
/* JADX INFO: Access modifiers changed from: package-private */
public static GradientFill parse(JsonReader jsonReader, LottieComposition lottieComposition) throws IOException {
AnimatableIntegerValue animatableIntegerValue = null;
Path.FillType fillType = Path.FillType.WINDING;
String str = null;
GradientType gradientType = null;
AnimatableGradientColorValue animatableGradientColorValue = null;
AnimatablePointValue animatablePointValue = null;
AnimatablePointValue animatablePointValue2 = null;
boolean z = false;
while (jsonReader.hasNext()) {
switch (jsonReader.selectName(NAMES)) {
case 0:
str = jsonReader.nextString();
break;
case 1:
jsonReader.beginObject();
int i = -1;
while (jsonReader.hasNext()) {
int selectName = jsonReader.selectName(GRADIENT_NAMES);
if (selectName == 0) {
i = jsonReader.nextInt();
} else if (selectName == 1) {
animatableGradientColorValue = AnimatableValueParser.parseGradientColor(jsonReader, lottieComposition, i);
} else {
jsonReader.skipName();
jsonReader.skipValue();
}
}
jsonReader.endObject();
break;
case 2:
animatableIntegerValue = AnimatableValueParser.parseInteger(jsonReader, lottieComposition);
break;
case 3:
gradientType = jsonReader.nextInt() == 1 ? GradientType.LINEAR : GradientType.RADIAL;
break;
case 4:
animatablePointValue = AnimatableValueParser.parsePoint(jsonReader, lottieComposition);
break;
case 5:
animatablePointValue2 = AnimatableValueParser.parsePoint(jsonReader, lottieComposition);
break;
case 6:
fillType = jsonReader.nextInt() == 1 ? Path.FillType.WINDING : Path.FillType.EVEN_ODD;
break;
case 7:
z = jsonReader.nextBoolean();
break;
default:
jsonReader.skipName();
jsonReader.skipValue();
break;
}
}
return new GradientFill(str, gradientType, fillType, animatableGradientColorValue, animatableIntegerValue == null ? new AnimatableIntegerValue(Collections.singletonList(new Keyframe(100))) : animatableIntegerValue, animatablePointValue, animatablePointValue2, null, null, z);
}
}