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

82 lines
3.0 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.airbnb.lottie.parser;
import com.airbnb.lottie.model.DocumentData;
import com.airbnb.lottie.parser.moshi.JsonReader;
import java.io.IOException;
/* loaded from: classes.dex */
public class DocumentDataParser implements ValueParser<DocumentData> {
public static final DocumentDataParser INSTANCE = new DocumentDataParser();
private static final JsonReader.Options NAMES = JsonReader.Options.of("t", "f", "s", "j", "tr", "lh", "ls", "fc", "sc", "sw", "of");
private DocumentDataParser() {
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // com.airbnb.lottie.parser.ValueParser
public DocumentData parse(JsonReader jsonReader, float f) throws IOException {
DocumentData.Justification justification = DocumentData.Justification.CENTER;
jsonReader.beginObject();
DocumentData.Justification justification2 = justification;
String str = null;
String str2 = null;
float f2 = 0.0f;
float f3 = 0.0f;
float f4 = 0.0f;
float f5 = 0.0f;
int i = 0;
int i2 = 0;
int i3 = 0;
boolean z = true;
while (jsonReader.hasNext()) {
switch (jsonReader.selectName(NAMES)) {
case 0:
str = jsonReader.nextString();
break;
case 1:
str2 = jsonReader.nextString();
break;
case 2:
f2 = (float) jsonReader.nextDouble();
break;
case 3:
int nextInt = jsonReader.nextInt();
if (nextInt > DocumentData.Justification.CENTER.ordinal() || nextInt < 0) {
justification2 = DocumentData.Justification.CENTER;
break;
} else {
justification2 = DocumentData.Justification.values()[nextInt];
break;
}
case 4:
i = jsonReader.nextInt();
break;
case 5:
f3 = (float) jsonReader.nextDouble();
break;
case 6:
f4 = (float) jsonReader.nextDouble();
break;
case 7:
i2 = JsonUtils.jsonToColor(jsonReader);
break;
case 8:
i3 = JsonUtils.jsonToColor(jsonReader);
break;
case 9:
f5 = (float) jsonReader.nextDouble();
break;
case 10:
z = jsonReader.nextBoolean();
break;
default:
jsonReader.skipName();
jsonReader.skipValue();
break;
}
}
jsonReader.endObject();
return new DocumentData(str, str2, f2, justification2, i, f3, f4, i2, i3, f5, z);
}
}