Rabbit-R1/switch port/java/sources/com/airbnb/lottie/parser/PointFParser.java
2024-05-21 17:08:36 -04:00

33 lines
1.2 KiB
Java

package com.airbnb.lottie.parser;
import android.graphics.PointF;
import com.airbnb.lottie.parser.moshi.JsonReader;
import java.io.IOException;
/* loaded from: classes2.dex */
public class PointFParser implements ValueParser<PointF> {
public static final PointFParser INSTANCE = new PointFParser();
private PointFParser() {
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // com.airbnb.lottie.parser.ValueParser
public PointF parse(JsonReader jsonReader, float f) throws IOException {
JsonReader.Token peek = jsonReader.peek();
if (peek == JsonReader.Token.BEGIN_ARRAY) {
return JsonUtils.jsonToPoint(jsonReader, f);
}
if (peek == JsonReader.Token.BEGIN_OBJECT) {
return JsonUtils.jsonToPoint(jsonReader, f);
}
if (peek == JsonReader.Token.NUMBER) {
PointF pointF = new PointF(((float) jsonReader.nextDouble()) * f, ((float) jsonReader.nextDouble()) * f);
while (jsonReader.hasNext()) {
jsonReader.skipValue();
}
return pointF;
}
throw new IllegalArgumentException("Cannot convert json to point. Next token is " + peek);
}
}