.class Lcom/moji/lottie/AnimatableValueParser;
.super Ljava/lang/Object;
.source "AnimatableValueParser.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/lottie/AnimatableValueParser$Result;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Ljava/lang/Object;",
        ">",
        "Ljava/lang/Object;"
    }
.end annotation


# instance fields
.field private final a:Lorg/json/JSONObject;
    .annotation build Landroid/support/annotation/Nullable;
    .end annotation
.end field

.field private final b:F

.field private final c:Lcom/moji/lottie/LottieComposition;

.field private final d:Lcom/moji/lottie/AnimatableValue$Factory;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/moji/lottie/AnimatableValue$Factory<",
            "TT;>;"
        }
    .end annotation
.end field


# direct methods
.method private constructor <init>(Lorg/json/JSONObject;FLcom/moji/lottie/LottieComposition;Lcom/moji/lottie/AnimatableValue$Factory;)V
    .locals 0
    .param p1    # Lorg/json/JSONObject;
        .annotation build Landroid/support/annotation/Nullable;
        .end annotation
    .end param
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/json/JSONObject;",
            "F",
            "Lcom/moji/lottie/LottieComposition;",
            "Lcom/moji/lottie/AnimatableValue$Factory<",
            "TT;>;)V"
        }
    .end annotation

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

    .line 20
    iput-object p1, p0, Lcom/moji/lottie/AnimatableValueParser;->a:Lorg/json/JSONObject;

    .line 21
    iput p2, p0, Lcom/moji/lottie/AnimatableValueParser;->b:F

    .line 22
    iput-object p3, p0, Lcom/moji/lottie/AnimatableValueParser;->c:Lcom/moji/lottie/LottieComposition;

    .line 23
    iput-object p4, p0, Lcom/moji/lottie/AnimatableValueParser;->d:Lcom/moji/lottie/AnimatableValue$Factory;

    return-void
.end method

.method static a(Lorg/json/JSONObject;FLcom/moji/lottie/LottieComposition;Lcom/moji/lottie/AnimatableValue$Factory;)Lcom/moji/lottie/AnimatableValueParser;
    .locals 1
    .param p0    # Lorg/json/JSONObject;
        .annotation build Landroid/support/annotation/Nullable;
        .end annotation
    .end param
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Lorg/json/JSONObject;",
            "F",
            "Lcom/moji/lottie/LottieComposition;",
            "Lcom/moji/lottie/AnimatableValue$Factory<",
            "TT;>;)",
            "Lcom/moji/lottie/AnimatableValueParser<",
            "TT;>;"
        }
    .end annotation

    .line 28
    new-instance v0, Lcom/moji/lottie/AnimatableValueParser;

    invoke-direct {v0, p0, p1, p2, p3}, Lcom/moji/lottie/AnimatableValueParser;-><init>(Lorg/json/JSONObject;FLcom/moji/lottie/LottieComposition;Lcom/moji/lottie/AnimatableValue$Factory;)V

    return-object v0
.end method

.method private a(Ljava/util/List;)Ljava/lang/Object;
    .locals 2
    .annotation build Landroid/support/annotation/Nullable;
    .end annotation

    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Lcom/moji/lottie/Keyframe<",
            "TT;>;>;)TT;"
        }
    .end annotation

    .line 52
    iget-object v0, p0, Lcom/moji/lottie/AnimatableValueParser;->a:Lorg/json/JSONObject;

    if-eqz v0, :cond_1

    .line 53
    invoke-interface {p1}, Ljava/util/List;->isEmpty()Z

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x0

    .line 54
    invoke-interface {p1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lcom/moji/lottie/Keyframe;

    iget-object p1, p1, Lcom/moji/lottie/Keyframe;->a:Ljava/lang/Object;

    return-object p1

    .line 56
    :cond_0
    iget-object p1, p0, Lcom/moji/lottie/AnimatableValueParser;->d:Lcom/moji/lottie/AnimatableValue$Factory;

    iget-object v0, p0, Lcom/moji/lottie/AnimatableValueParser;->a:Lorg/json/JSONObject;

    const-string v1, "k"

    invoke-virtual {v0, v1}, Lorg/json/JSONObject;->opt(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    iget v1, p0, Lcom/moji/lottie/AnimatableValueParser;->b:F

    invoke-interface {p1, v0, v1}, Lcom/moji/lottie/AnimatableValue$Factory;->b(Ljava/lang/Object;F)Ljava/lang/Object;

    move-result-object p1

    return-object p1

    :cond_1
    const/4 p1, 0x0

    return-object p1
.end method

.method private static a(Ljava/lang/Object;)Z
    .locals 2

    .line 64
    instance-of v0, p0, Lorg/json/JSONArray;

    const/4 v1, 0x0

    if-nez v0, :cond_0

    return v1

    .line 67
    :cond_0
    check-cast p0, Lorg/json/JSONArray;

    invoke-virtual {p0, v1}, Lorg/json/JSONArray;->opt(I)Ljava/lang/Object;

    move-result-object p0

    .line 68
    instance-of v0, p0, Lorg/json/JSONObject;

    if-eqz v0, :cond_1

    check-cast p0, Lorg/json/JSONObject;

    const-string v0, "t"

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

    move-result p0

    if-eqz p0, :cond_1

    const/4 v1, 0x1

    :cond_1
    return v1
.end method

.method private b()Ljava/util/List;
    .locals 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List<",
            "Lcom/moji/lottie/Keyframe<",
            "TT;>;>;"
        }
    .end annotation

    .line 38
    iget-object v0, p0, Lcom/moji/lottie/AnimatableValueParser;->a:Lorg/json/JSONObject;

    if-eqz v0, :cond_1

    .line 39
    iget-object v0, p0, Lcom/moji/lottie/AnimatableValueParser;->a:Lorg/json/JSONObject;

    const-string v1, "k"

    invoke-virtual {v0, v1}, Lorg/json/JSONObject;->opt(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    .line 40
    invoke-static {v0}, Lcom/moji/lottie/AnimatableValueParser;->a(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 41
    check-cast v0, Lorg/json/JSONArray;

    iget-object v1, p0, Lcom/moji/lottie/AnimatableValueParser;->c:Lcom/moji/lottie/LottieComposition;

    iget v2, p0, Lcom/moji/lottie/AnimatableValueParser;->b:F

    iget-object v3, p0, Lcom/moji/lottie/AnimatableValueParser;->d:Lcom/moji/lottie/AnimatableValue$Factory;

    invoke-static {v0, v1, v2, v3}, Lcom/moji/lottie/Keyframe$Factory;->a(Lorg/json/JSONArray;Lcom/moji/lottie/LottieComposition;FLcom/moji/lottie/AnimatableValue$Factory;)Ljava/util/List;

    move-result-object v0

    return-object v0

    .line 43
    :cond_0
    invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List;

    move-result-object v0

    return-object v0

    .line 46
    :cond_1
    invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List;

    move-result-object v0

    return-object v0
.end method


# virtual methods
.method a()Lcom/moji/lottie/AnimatableValueParser$Result;
    .locals 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Lcom/moji/lottie/AnimatableValueParser$Result<",
            "TT;>;"
        }
    .end annotation

    .line 32
    invoke-direct {p0}, Lcom/moji/lottie/AnimatableValueParser;->b()Ljava/util/List;

    move-result-object v0

    .line 33
    invoke-direct {p0, v0}, Lcom/moji/lottie/AnimatableValueParser;->a(Ljava/util/List;)Ljava/lang/Object;

    move-result-object v1

    .line 34
    new-instance v2, Lcom/moji/lottie/AnimatableValueParser$Result;

    invoke-direct {v2, v0, v1}, Lcom/moji/lottie/AnimatableValueParser$Result;-><init>(Ljava/util/List;Ljava/lang/Object;)V

    return-object v2
.end method
