.class Lcom/airbnb/lottie/parser/JsonUtils; .super Ljava/lang/Object; .source "JsonUtils.java" # static fields .field private static final POINT_NAMES:Lcom/airbnb/lottie/parser/moshi/JsonReader$Options; # direct methods .method static constructor ()V .locals 2 const-string v0, "x" const-string v1, "y" .line 81 filled-new-array {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/JsonUtils;->POINT_NAMES:Lcom/airbnb/lottie/parser/moshi/JsonReader$Options; return-void .end method .method private constructor ()V .locals 0 .line 15 invoke-direct {p0}, Ljava/lang/Object;->()V return-void .end method .method private static jsonArrayToPoint(Lcom/airbnb/lottie/parser/moshi/JsonReader;F)Landroid/graphics/PointF; .locals 4 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 71 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->beginArray()V .line 72 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->nextDouble()D move-result-wide v0 double-to-float v0, v0 .line 73 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->nextDouble()D move-result-wide v1 double-to-float v1, v1 .line 74 :goto_0 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->peek()Lcom/airbnb/lottie/parser/moshi/JsonReader$Token; move-result-object v2 sget-object v3, Lcom/airbnb/lottie/parser/moshi/JsonReader$Token;->END_ARRAY:Lcom/airbnb/lottie/parser/moshi/JsonReader$Token; if-eq v2, v3, :cond_0 .line 75 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->skipValue()V goto :goto_0 .line 77 :cond_0 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->endArray()V .line 78 new-instance p0, Landroid/graphics/PointF; mul-float/2addr v0, p1 mul-float/2addr v1, p1 invoke-direct {p0, v0, v1}, Landroid/graphics/PointF;->(FF)V return-object p0 .end method .method private static jsonNumbersToPoint(Lcom/airbnb/lottie/parser/moshi/JsonReader;F)Landroid/graphics/PointF; .locals 3 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 60 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->nextDouble()D move-result-wide v0 double-to-float v0, v0 .line 61 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->nextDouble()D move-result-wide v1 double-to-float v1, v1 .line 62 :goto_0 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->hasNext()Z move-result v2 if-eqz v2, :cond_0 .line 63 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->skipValue()V goto :goto_0 .line 65 :cond_0 new-instance p0, Landroid/graphics/PointF; mul-float/2addr v0, p1 mul-float/2addr v1, p1 invoke-direct {p0, v0, v1}, Landroid/graphics/PointF;->(FF)V return-object p0 .end method .method private static jsonObjectToPoint(Lcom/airbnb/lottie/parser/moshi/JsonReader;F)Landroid/graphics/PointF; .locals 4 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 86 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->beginObject()V const/4 v0, 0x0 move v1, v0 .line 87 :goto_0 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->hasNext()Z move-result v2 if-eqz v2, :cond_2 sget-object v2, Lcom/airbnb/lottie/parser/JsonUtils;->POINT_NAMES:Lcom/airbnb/lottie/parser/moshi/JsonReader$Options; .line 88 invoke-virtual {p0, v2}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->selectName(Lcom/airbnb/lottie/parser/moshi/JsonReader$Options;)I move-result v2 if-eqz v2, :cond_1 const/4 v3, 0x1 if-eq v2, v3, :cond_0 .line 96 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->skipName()V .line 97 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->skipValue()V goto :goto_0 .line 93 :cond_0 invoke-static {p0}, Lcom/airbnb/lottie/parser/JsonUtils;->valueFromObject(Lcom/airbnb/lottie/parser/moshi/JsonReader;)F move-result v1 goto :goto_0 .line 90 :cond_1 invoke-static {p0}, Lcom/airbnb/lottie/parser/JsonUtils;->valueFromObject(Lcom/airbnb/lottie/parser/moshi/JsonReader;)F move-result v0 goto :goto_0 .line 100 :cond_2 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->endObject()V .line 101 new-instance p0, Landroid/graphics/PointF; mul-float/2addr v0, p1 mul-float/2addr v1, p1 invoke-direct {p0, v0, v1}, Landroid/graphics/PointF;->(FF)V return-object p0 .end method .method static jsonToColor(Lcom/airbnb/lottie/parser/moshi/JsonReader;)I .locals 6 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 22 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->beginArray()V .line 23 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->nextDouble()D move-result-wide v0 const-wide v2, 0x406fe00000000000L # 255.0 mul-double/2addr v0, v2 double-to-int v0, v0 .line 24 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->nextDouble()D move-result-wide v4 mul-double/2addr v4, v2 double-to-int v1, v4 .line 25 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->nextDouble()D move-result-wide v4 mul-double/2addr v4, v2 double-to-int v2, v4 .line 26 :goto_0 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->hasNext()Z move-result v3 if-eqz v3, :cond_0 .line 27 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->skipValue()V goto :goto_0 .line 29 :cond_0 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->endArray()V const/16 p0, 0xff .line 30 invoke-static {p0, v0, v1, v2}, Landroid/graphics/Color;->argb(IIII)I move-result p0 return p0 .end method .method static jsonToPoint(Lcom/airbnb/lottie/parser/moshi/JsonReader;F)Landroid/graphics/PointF; .locals 2 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 47 sget-object v0, Lcom/airbnb/lottie/parser/JsonUtils$1;->$SwitchMap$com$airbnb$lottie$parser$moshi$JsonReader$Token:[I invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->peek()Lcom/airbnb/lottie/parser/moshi/JsonReader$Token; move-result-object v1 invoke-virtual {v1}, Lcom/airbnb/lottie/parser/moshi/JsonReader$Token;->ordinal()I move-result v1 aget v0, v0, v1 const/4 v1, 0x1 if-eq v0, v1, :cond_2 const/4 v1, 0x2 if-eq v0, v1, :cond_1 const/4 v1, 0x3 if-ne v0, v1, :cond_0 .line 53 invoke-static {p0, p1}, Lcom/airbnb/lottie/parser/JsonUtils;->jsonObjectToPoint(Lcom/airbnb/lottie/parser/moshi/JsonReader;F)Landroid/graphics/PointF; move-result-object p0 return-object p0 .line 55 :cond_0 new-instance p1, Ljava/lang/IllegalArgumentException; new-instance v0, Ljava/lang/StringBuilder; const-string v1, "Unknown point starts with " invoke-direct {v0, v1}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->peek()Lcom/airbnb/lottie/parser/moshi/JsonReader$Token; move-result-object p0 invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; move-result-object p0 invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 invoke-direct {p1, p0}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V throw p1 .line 51 :cond_1 invoke-static {p0, p1}, Lcom/airbnb/lottie/parser/JsonUtils;->jsonArrayToPoint(Lcom/airbnb/lottie/parser/moshi/JsonReader;F)Landroid/graphics/PointF; move-result-object p0 return-object p0 .line 49 :cond_2 invoke-static {p0, p1}, Lcom/airbnb/lottie/parser/JsonUtils;->jsonNumbersToPoint(Lcom/airbnb/lottie/parser/moshi/JsonReader;F)Landroid/graphics/PointF; move-result-object p0 return-object p0 .end method .method static jsonToPoints(Lcom/airbnb/lottie/parser/moshi/JsonReader;F)Ljava/util/List; .locals 3 .annotation system Ldalvik/annotation/Signature; value = { "(", "Lcom/airbnb/lottie/parser/moshi/JsonReader;", "F)", "Ljava/util/List<", "Landroid/graphics/PointF;", ">;" } .end annotation .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 34 new-instance v0, Ljava/util/ArrayList; invoke-direct {v0}, Ljava/util/ArrayList;->()V .line 36 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->beginArray()V .line 37 :goto_0 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->peek()Lcom/airbnb/lottie/parser/moshi/JsonReader$Token; move-result-object v1 sget-object v2, Lcom/airbnb/lottie/parser/moshi/JsonReader$Token;->BEGIN_ARRAY:Lcom/airbnb/lottie/parser/moshi/JsonReader$Token; if-ne v1, v2, :cond_0 .line 38 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->beginArray()V .line 39 invoke-static {p0, p1}, Lcom/airbnb/lottie/parser/JsonUtils;->jsonToPoint(Lcom/airbnb/lottie/parser/moshi/JsonReader;F)Landroid/graphics/PointF; move-result-object v1 invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z .line 40 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->endArray()V goto :goto_0 .line 42 :cond_0 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->endArray()V return-object v0 .end method .method static valueFromObject(Lcom/airbnb/lottie/parser/moshi/JsonReader;)F .locals 3 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation .line 105 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->peek()Lcom/airbnb/lottie/parser/moshi/JsonReader$Token; move-result-object v0 .line 106 sget-object v1, Lcom/airbnb/lottie/parser/JsonUtils$1;->$SwitchMap$com$airbnb$lottie$parser$moshi$JsonReader$Token:[I invoke-virtual {v0}, Lcom/airbnb/lottie/parser/moshi/JsonReader$Token;->ordinal()I move-result v2 aget v1, v1, v2 const/4 v2, 0x1 if-eq v1, v2, :cond_2 const/4 v2, 0x2 if-ne v1, v2, :cond_1 .line 110 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->beginArray()V .line 111 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->nextDouble()D move-result-wide v0 double-to-float v0, v0 .line 112 :goto_0 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->hasNext()Z move-result v1 if-eqz v1, :cond_0 .line 113 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->skipValue()V goto :goto_0 .line 115 :cond_0 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->endArray()V return v0 .line 118 :cond_1 new-instance p0, Ljava/lang/IllegalArgumentException; new-instance v1, Ljava/lang/StringBuilder; const-string v2, "Unknown value for token of type " invoke-direct {v1, v2}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; move-result-object v0 invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V throw p0 .line 108 :cond_2 invoke-virtual {p0}, Lcom/airbnb/lottie/parser/moshi/JsonReader;->nextDouble()D move-result-wide v0 double-to-float p0, v0 return p0 .end method