mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2025-01-09 13:43:22 +00:00
375 lines
9.4 KiB
Smali
375 lines
9.4 KiB
Smali
.class public Lcom/airbnb/lottie/parser/ShapeDataParser;
|
|
.super Ljava/lang/Object;
|
|
.source "ShapeDataParser.java"
|
|
|
|
# interfaces
|
|
.implements Lcom/airbnb/lottie/parser/ValueParser;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/lang/Object;",
|
|
"Lcom/airbnb/lottie/parser/ValueParser<",
|
|
"Lcom/airbnb/lottie/model/content/ShapeData;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final INSTANCE:Lcom/airbnb/lottie/parser/ShapeDataParser;
|
|
|
|
.field private static final NAMES:Lcom/airbnb/lottie/parser/moshi/JsonReader$Options;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 4
|
|
|
|
.line 16
|
|
new-instance v0, Lcom/airbnb/lottie/parser/ShapeDataParser;
|
|
|
|
invoke-direct {v0}, Lcom/airbnb/lottie/parser/ShapeDataParser;-><init>()V
|
|
|
|
sput-object v0, Lcom/airbnb/lottie/parser/ShapeDataParser;->INSTANCE:Lcom/airbnb/lottie/parser/ShapeDataParser;
|
|
|
|
const-string v0, "i"
|
|
|
|
const-string v1, "o"
|
|
|
|
const-string v2, "c"
|
|
|
|
const-string v3, "v"
|
|
|
|
.line 17
|
|
filled-new-array {v2, v3, v0, v1}, [Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lcom/airbnb/lottie/parser/moshi/JsonReader$Options;->of([Ljava/lang/String;)Lcom/airbnb/lottie/parser/moshi/JsonReader$Options;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lcom/airbnb/lottie/parser/ShapeDataParser;->NAMES:Lcom/airbnb/lottie/parser/moshi/JsonReader$Options;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 24
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public parse(Lcom/airbnb/lottie/parser/moshi/JsonReader;F)Lcom/airbnb/lottie/model/content/ShapeData;
|
|
.locals 11
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 31
|
|
invoke-virtual {p1}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->peek()Lcom/airbnb/lottie/parser/moshi/JsonReader$Token;
|
|
|
|
move-result-object p0
|
|
|
|
sget-object v0, Lcom/airbnb/lottie/parser/moshi/JsonReader$Token;->BEGIN_ARRAY:Lcom/airbnb/lottie/parser/moshi/JsonReader$Token;
|
|
|
|
if-ne p0, v0, :cond_0
|
|
|
|
.line 32
|
|
invoke-virtual {p1}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->beginArray()V
|
|
|
|
.line 39
|
|
:cond_0
|
|
invoke-virtual {p1}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->beginObject()V
|
|
|
|
const/4 p0, 0x0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
move-object v1, p0
|
|
|
|
move-object v2, v1
|
|
|
|
move v3, v0
|
|
|
|
.line 41
|
|
:goto_0
|
|
invoke-virtual {p1}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->hasNext()Z
|
|
|
|
move-result v4
|
|
|
|
const/4 v5, 0x1
|
|
|
|
if-eqz v4, :cond_5
|
|
|
|
sget-object v4, Lcom/airbnb/lottie/parser/ShapeDataParser;->NAMES:Lcom/airbnb/lottie/parser/moshi/JsonReader$Options;
|
|
|
|
.line 42
|
|
invoke-virtual {p1, v4}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->selectName(Lcom/airbnb/lottie/parser/moshi/JsonReader$Options;)I
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_4
|
|
|
|
if-eq v4, v5, :cond_3
|
|
|
|
const/4 v5, 0x2
|
|
|
|
if-eq v4, v5, :cond_2
|
|
|
|
const/4 v5, 0x3
|
|
|
|
if-eq v4, v5, :cond_1
|
|
|
|
.line 56
|
|
invoke-virtual {p1}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->skipName()V
|
|
|
|
.line 57
|
|
invoke-virtual {p1}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->skipValue()V
|
|
|
|
goto :goto_0
|
|
|
|
.line 53
|
|
:cond_1
|
|
invoke-static {p1, p2}, Lcom/airbnb/lottie/parser/JsonUtils;->jsonToPoints(Lcom/airbnb/lottie/parser/moshi/JsonReader;F)Ljava/util/List;
|
|
|
|
move-result-object v2
|
|
|
|
goto :goto_0
|
|
|
|
.line 50
|
|
:cond_2
|
|
invoke-static {p1, p2}, Lcom/airbnb/lottie/parser/JsonUtils;->jsonToPoints(Lcom/airbnb/lottie/parser/moshi/JsonReader;F)Ljava/util/List;
|
|
|
|
move-result-object v1
|
|
|
|
goto :goto_0
|
|
|
|
.line 47
|
|
:cond_3
|
|
invoke-static {p1, p2}, Lcom/airbnb/lottie/parser/JsonUtils;->jsonToPoints(Lcom/airbnb/lottie/parser/moshi/JsonReader;F)Ljava/util/List;
|
|
|
|
move-result-object p0
|
|
|
|
goto :goto_0
|
|
|
|
.line 44
|
|
:cond_4
|
|
invoke-virtual {p1}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->nextBoolean()Z
|
|
|
|
move-result v3
|
|
|
|
goto :goto_0
|
|
|
|
.line 61
|
|
:cond_5
|
|
invoke-virtual {p1}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->endObject()V
|
|
|
|
.line 63
|
|
invoke-virtual {p1}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->peek()Lcom/airbnb/lottie/parser/moshi/JsonReader$Token;
|
|
|
|
move-result-object p2
|
|
|
|
sget-object v4, Lcom/airbnb/lottie/parser/moshi/JsonReader$Token;->END_ARRAY:Lcom/airbnb/lottie/parser/moshi/JsonReader$Token;
|
|
|
|
if-ne p2, v4, :cond_6
|
|
|
|
.line 64
|
|
invoke-virtual {p1}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->endArray()V
|
|
|
|
:cond_6
|
|
if-eqz p0, :cond_a
|
|
|
|
if-eqz v1, :cond_a
|
|
|
|
if-eqz v2, :cond_a
|
|
|
|
.line 71
|
|
invoke-interface {p0}, Ljava/util/List;->isEmpty()Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_7
|
|
|
|
.line 72
|
|
new-instance p0, Lcom/airbnb/lottie/model/content/ShapeData;
|
|
|
|
new-instance p1, Landroid/graphics/PointF;
|
|
|
|
invoke-direct {p1}, Landroid/graphics/PointF;-><init>()V
|
|
|
|
invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p0, p1, v0, p2}, Lcom/airbnb/lottie/model/content/ShapeData;-><init>(Landroid/graphics/PointF;ZLjava/util/List;)V
|
|
|
|
return-object p0
|
|
|
|
.line 75
|
|
:cond_7
|
|
invoke-interface {p0}, Ljava/util/List;->size()I
|
|
|
|
move-result p1
|
|
|
|
.line 76
|
|
invoke-interface {p0, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, Landroid/graphics/PointF;
|
|
|
|
.line 78
|
|
new-instance v4, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v4, p1}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
move v6, v5
|
|
|
|
:goto_1
|
|
if-ge v6, p1, :cond_8
|
|
|
|
.line 81
|
|
invoke-interface {p0, v6}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v7
|
|
|
|
check-cast v7, Landroid/graphics/PointF;
|
|
|
|
add-int/lit8 v8, v6, -0x1
|
|
|
|
.line 82
|
|
invoke-interface {p0, v8}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v9
|
|
|
|
check-cast v9, Landroid/graphics/PointF;
|
|
|
|
.line 83
|
|
invoke-interface {v2, v8}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v8
|
|
|
|
check-cast v8, Landroid/graphics/PointF;
|
|
|
|
.line 84
|
|
invoke-interface {v1, v6}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v10
|
|
|
|
check-cast v10, Landroid/graphics/PointF;
|
|
|
|
.line 85
|
|
invoke-static {v9, v8}, Lcom/airbnb/lottie/utils/MiscUtils;->addPoints(Landroid/graphics/PointF;Landroid/graphics/PointF;)Landroid/graphics/PointF;
|
|
|
|
move-result-object v8
|
|
|
|
.line 86
|
|
invoke-static {v7, v10}, Lcom/airbnb/lottie/utils/MiscUtils;->addPoints(Landroid/graphics/PointF;Landroid/graphics/PointF;)Landroid/graphics/PointF;
|
|
|
|
move-result-object v9
|
|
|
|
.line 87
|
|
new-instance v10, Lcom/airbnb/lottie/model/CubicCurveData;
|
|
|
|
invoke-direct {v10, v8, v9, v7}, Lcom/airbnb/lottie/model/CubicCurveData;-><init>(Landroid/graphics/PointF;Landroid/graphics/PointF;Landroid/graphics/PointF;)V
|
|
|
|
invoke-interface {v4, v10}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
add-int/lit8 v6, v6, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_8
|
|
if-eqz v3, :cond_9
|
|
|
|
.line 91
|
|
invoke-interface {p0, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v6
|
|
|
|
check-cast v6, Landroid/graphics/PointF;
|
|
|
|
sub-int/2addr p1, v5
|
|
|
|
.line 92
|
|
invoke-interface {p0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, Landroid/graphics/PointF;
|
|
|
|
.line 93
|
|
invoke-interface {v2, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroid/graphics/PointF;
|
|
|
|
.line 94
|
|
invoke-interface {v1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/graphics/PointF;
|
|
|
|
.line 96
|
|
invoke-static {p0, p1}, Lcom/airbnb/lottie/utils/MiscUtils;->addPoints(Landroid/graphics/PointF;Landroid/graphics/PointF;)Landroid/graphics/PointF;
|
|
|
|
move-result-object p0
|
|
|
|
.line 97
|
|
invoke-static {v6, v0}, Lcom/airbnb/lottie/utils/MiscUtils;->addPoints(Landroid/graphics/PointF;Landroid/graphics/PointF;)Landroid/graphics/PointF;
|
|
|
|
move-result-object p1
|
|
|
|
.line 99
|
|
new-instance v0, Lcom/airbnb/lottie/model/CubicCurveData;
|
|
|
|
invoke-direct {v0, p0, p1, v6}, Lcom/airbnb/lottie/model/CubicCurveData;-><init>(Landroid/graphics/PointF;Landroid/graphics/PointF;Landroid/graphics/PointF;)V
|
|
|
|
invoke-interface {v4, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
.line 101
|
|
:cond_9
|
|
new-instance p0, Lcom/airbnb/lottie/model/content/ShapeData;
|
|
|
|
invoke-direct {p0, p2, v3, v4}, Lcom/airbnb/lottie/model/content/ShapeData;-><init>(Landroid/graphics/PointF;ZLjava/util/List;)V
|
|
|
|
return-object p0
|
|
|
|
.line 68
|
|
:cond_a
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p1, "Shape data was missing information."
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public bridge synthetic parse(Lcom/airbnb/lottie/parser/moshi/JsonReader;F)Ljava/lang/Object;
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 15
|
|
invoke-virtual {p0, p1, p2}, Lcom/airbnb/lottie/parser/ShapeDataParser;->parse(Lcom/airbnb/lottie/parser/moshi/JsonReader;F)Lcom/airbnb/lottie/model/content/ShapeData;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|