mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2024-12-25 16:42:30 -06:00
33 lines
1.2 KiB
Java
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);
|
|
}
|
|
}
|