.class Lcom/moji/lottie/GradientFill$Factory;
.super Ljava/lang/Object;
.source "GradientFill.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/moji/lottie/GradientFill;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = "Factory"
.end annotation


# direct methods
.method private constructor <init>()V
    .locals 0

    .line 78
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method static a(Lorg/json/JSONObject;Lcom/moji/lottie/LottieComposition;)Lcom/moji/lottie/GradientFill;
    .locals 12

    const-string v0, "nm"

    .line 82
    invoke-virtual {p0, v0}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    const-string v0, "g"

    .line 84
    invoke-virtual {p0, v0}, Lorg/json/JSONObject;->optJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v0

    if-eqz v0, :cond_0

    const-string v1, "k"

    .line 85
    invoke-virtual {v0, v1}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_0

    const-string v1, "p"

    .line 88
    invoke-virtual {v0, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v1

    const-string v3, "k"

    .line 89
    invoke-virtual {v0, v3}, Lorg/json/JSONObject;->optJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v0

    :try_start_0
    const-string v3, "p"

    .line 91
    invoke-virtual {v0, v3, v1}, Lorg/json/JSONObject;->put(Ljava/lang/String;I)Lorg/json/JSONObject;
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    :catch_0
    :cond_0
    const/4 v1, 0x0

    if-eqz v0, :cond_1

    .line 98
    invoke-static {v0, p1}, Lcom/moji/lottie/AnimatableGradientColorValue$Factory;->a(Lorg/json/JSONObject;Lcom/moji/lottie/LottieComposition;)Lcom/moji/lottie/AnimatableGradientColorValue;

    move-result-object v0

    move-object v5, v0

    goto :goto_0

    :cond_1
    move-object v5, v1

    :goto_0
    const-string v0, "o"

    .line 101
    invoke-virtual {p0, v0}, Lorg/json/JSONObject;->optJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v0

    if-eqz v0, :cond_2

    .line 104
    invoke-static {v0, p1}, Lcom/moji/lottie/AnimatableIntegerValue$Factory;->a(Lorg/json/JSONObject;Lcom/moji/lottie/LottieComposition;)Lcom/moji/lottie/AnimatableIntegerValue;

    move-result-object v0

    move-object v6, v0

    goto :goto_1

    :cond_2
    move-object v6, v1

    :goto_1
    const-string v0, "r"

    const/4 v3, 0x1

    .line 107
    invoke-virtual {p0, v0, v3}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;I)I

    move-result v0

    if-ne v0, v3, :cond_3

    .line 108
    sget-object v0, Landroid/graphics/Path$FillType;->WINDING:Landroid/graphics/Path$FillType;

    :goto_2
    move-object v4, v0

    goto :goto_3

    :cond_3
    sget-object v0, Landroid/graphics/Path$FillType;->EVEN_ODD:Landroid/graphics/Path$FillType;

    goto :goto_2

    :goto_3
    const-string v0, "t"

    .line 110
    invoke-virtual {p0, v0, v3}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;I)I

    move-result v0

    if-ne v0, v3, :cond_4

    .line 111
    sget-object v0, Lcom/moji/lottie/GradientType;->Linear:Lcom/moji/lottie/GradientType;

    :goto_4
    move-object v3, v0

    goto :goto_5

    :cond_4
    sget-object v0, Lcom/moji/lottie/GradientType;->Radial:Lcom/moji/lottie/GradientType;

    goto :goto_4

    :goto_5
    const-string v0, "s"

    .line 113
    invoke-virtual {p0, v0}, Lorg/json/JSONObject;->optJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v0

    if-eqz v0, :cond_5

    .line 116
    invoke-static {v0, p1}, Lcom/moji/lottie/AnimatablePointValue$Factory;->a(Lorg/json/JSONObject;Lcom/moji/lottie/LottieComposition;)Lcom/moji/lottie/AnimatablePointValue;

    move-result-object v0

    move-object v7, v0

    goto :goto_6

    :cond_5
    move-object v7, v1

    :goto_6
    const-string v0, "e"

    .line 119
    invoke-virtual {p0, v0}, Lorg/json/JSONObject;->optJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object p0

    if-eqz p0, :cond_6

    .line 122
    invoke-static {p0, p1}, Lcom/moji/lottie/AnimatablePointValue$Factory;->a(Lorg/json/JSONObject;Lcom/moji/lottie/LottieComposition;)Lcom/moji/lottie/AnimatablePointValue;

    move-result-object p0

    move-object v8, p0

    goto :goto_7

    :cond_6
    move-object v8, v1

    .line 125
    :goto_7
    new-instance p0, Lcom/moji/lottie/GradientFill;

    const/4 v9, 0x0

    const/4 v10, 0x0

    const/4 v11, 0x0

    move-object v1, p0

    invoke-direct/range {v1 .. v11}, Lcom/moji/lottie/GradientFill;-><init>(Ljava/lang/String;Lcom/moji/lottie/GradientType;Landroid/graphics/Path$FillType;Lcom/moji/lottie/AnimatableGradientColorValue;Lcom/moji/lottie/AnimatableIntegerValue;Lcom/moji/lottie/AnimatablePointValue;Lcom/moji/lottie/AnimatablePointValue;Lcom/moji/lottie/AnimatableFloatValue;Lcom/moji/lottie/AnimatableFloatValue;Lcom/moji/lottie/GradientFill$1;)V

    return-object p0
.end method
