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

34 lines
1.2 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.airbnb.lottie.parser;
import android.graphics.PointF;
import com.airbnb.lottie.parser.moshi.JsonReader;
import java.io.IOException;
/* loaded from: classes.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 ".concat(String.valueOf(peek)));
}
}