mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2024-12-25 16:42:30 -06:00
98 lines
3.8 KiB
Java
98 lines
3.8 KiB
Java
package com.airbnb.lottie.parser;
|
|
|
|
import android.graphics.PointF;
|
|
import androidx.media3.exoplayer.upstream.CmcdHeadersFactory;
|
|
import com.airbnb.lottie.model.DocumentData;
|
|
import com.airbnb.lottie.parser.moshi.JsonReader;
|
|
import java.io.IOException;
|
|
|
|
/* loaded from: classes2.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", CmcdHeadersFactory.STREAMING_FORMAT_SS, "j", "tr", "lh", "ls", "fc", "sc", "sw", "of", "ps", "sz");
|
|
|
|
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;
|
|
PointF pointF = null;
|
|
PointF pointF2 = 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;
|
|
}
|
|
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;
|
|
case 11:
|
|
jsonReader.beginArray();
|
|
PointF pointF3 = new PointF(((float) jsonReader.nextDouble()) * f, ((float) jsonReader.nextDouble()) * f);
|
|
jsonReader.endArray();
|
|
pointF = pointF3;
|
|
break;
|
|
case 12:
|
|
jsonReader.beginArray();
|
|
PointF pointF4 = new PointF(((float) jsonReader.nextDouble()) * f, ((float) jsonReader.nextDouble()) * f);
|
|
jsonReader.endArray();
|
|
pointF2 = pointF4;
|
|
break;
|
|
default:
|
|
jsonReader.skipName();
|
|
jsonReader.skipValue();
|
|
break;
|
|
}
|
|
}
|
|
jsonReader.endObject();
|
|
return new DocumentData(str, str2, f2, justification2, i, f3, f4, i2, i3, f5, z, pointF, pointF2);
|
|
}
|
|
}
|