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

# interfaces
.implements Lcom/moji/lottie/AnimatableValue;


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

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Lcom/moji/lottie/AnimatableValue<",
        "Landroid/graphics/PointF;",
        ">;"
    }
.end annotation


# instance fields
.field private final a:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Lcom/moji/lottie/PathKeyframe;",
            ">;"
        }
    .end annotation
.end field

.field private b:Landroid/graphics/PointF;


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

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

    .line 23
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/moji/lottie/AnimatablePathValue;->a:Ljava/util/List;

    .line 30
    new-instance v0, Landroid/graphics/PointF;

    const/4 v1, 0x0

    invoke-direct {v0, v1, v1}, Landroid/graphics/PointF;-><init>(FF)V

    iput-object v0, p0, Lcom/moji/lottie/AnimatablePathValue;->b:Landroid/graphics/PointF;

    return-void
.end method

.method constructor <init>(Ljava/lang/Object;Lcom/moji/lottie/LottieComposition;)V
    .locals 4

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

    .line 23
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/moji/lottie/AnimatablePathValue;->a:Ljava/util/List;

    .line 34
    invoke-direct {p0, p1}, Lcom/moji/lottie/AnimatablePathValue;->a(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 35
    check-cast p1, Lorg/json/JSONArray;

    .line 36
    invoke-virtual {p1}, Lorg/json/JSONArray;->length()I

    move-result v0

    const/4 v1, 0x0

    :goto_0
    if-ge v1, v0, :cond_0

    .line 38
    invoke-virtual {p1, v1}, Lorg/json/JSONArray;->optJSONObject(I)Lorg/json/JSONObject;

    move-result-object v2

    .line 40
    invoke-static {}, Lcom/moji/lottie/AnimatablePathValue$ValueFactory;->a()Lcom/moji/lottie/AnimatableValue$Factory;

    move-result-object v3

    .line 39
    invoke-static {v2, p2, v3}, Lcom/moji/lottie/PathKeyframe$Factory;->a(Lorg/json/JSONObject;Lcom/moji/lottie/LottieComposition;Lcom/moji/lottie/AnimatableValue$Factory;)Lcom/moji/lottie/PathKeyframe;

    move-result-object v2

    .line 41
    iget-object v3, p0, Lcom/moji/lottie/AnimatablePathValue;->a:Ljava/util/List;

    invoke-interface {v3, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 43
    :cond_0
    iget-object p1, p0, Lcom/moji/lottie/AnimatablePathValue;->a:Ljava/util/List;

    invoke-static {p1}, Lcom/moji/lottie/Keyframe;->a(Ljava/util/List;)V

    goto :goto_1

    .line 45
    :cond_1
    check-cast p1, Lorg/json/JSONArray;

    invoke-virtual {p2}, Lcom/moji/lottie/LottieComposition;->g()F

    move-result p2

    invoke-static {p1, p2}, Lcom/moji/lottie/JsonUtils;->a(Lorg/json/JSONArray;F)Landroid/graphics/PointF;

    move-result-object p1

    iput-object p1, p0, Lcom/moji/lottie/AnimatablePathValue;->b:Landroid/graphics/PointF;

    :goto_1
    return-void
.end method

.method static a(Lorg/json/JSONObject;Lcom/moji/lottie/LottieComposition;)Lcom/moji/lottie/AnimatableValue;
    .locals 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/json/JSONObject;",
            "Lcom/moji/lottie/LottieComposition;",
            ")",
            "Lcom/moji/lottie/AnimatableValue<",
            "Landroid/graphics/PointF;",
            ">;"
        }
    .end annotation

    const-string v0, "k"

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

    move-result v0

    if-eqz v0, :cond_0

    .line 15
    new-instance v0, Lcom/moji/lottie/AnimatablePathValue;

    const-string v1, "k"

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

    move-result-object p0

    invoke-direct {v0, p0, p1}, Lcom/moji/lottie/AnimatablePathValue;-><init>(Ljava/lang/Object;Lcom/moji/lottie/LottieComposition;)V

    return-object v0

    .line 17
    :cond_0
    new-instance v0, Lcom/moji/lottie/AnimatableSplitDimensionPathValue;

    const-string v1, "x"

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

    move-result-object v1

    invoke-static {v1, p1}, Lcom/moji/lottie/AnimatableFloatValue$Factory;->a(Lorg/json/JSONObject;Lcom/moji/lottie/LottieComposition;)Lcom/moji/lottie/AnimatableFloatValue;

    move-result-object v1

    const-string v2, "y"

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

    move-result-object p0

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

    move-result-object p0

    invoke-direct {v0, v1, p0}, Lcom/moji/lottie/AnimatableSplitDimensionPathValue;-><init>(Lcom/moji/lottie/AnimatableFloatValue;Lcom/moji/lottie/AnimatableFloatValue;)V

    return-object v0
.end method

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

    .line 50
    instance-of v0, p1, Lorg/json/JSONArray;

    const/4 v1, 0x0

    if-nez v0, :cond_0

    return v1

    .line 54
    :cond_0
    check-cast p1, Lorg/json/JSONArray;

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

    move-result-object p1

    .line 55
    instance-of v0, p1, Lorg/json/JSONObject;

    if-eqz v0, :cond_1

    check-cast p1, Lorg/json/JSONObject;

    const-string v0, "t"

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

    move-result p1

    if-eqz p1, :cond_1

    const/4 v1, 0x1

    :cond_1
    return v1
.end method


# virtual methods
.method public a()Z
    .locals 1

    .line 69
    iget-object v0, p0, Lcom/moji/lottie/AnimatablePathValue;->a:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v0

    xor-int/lit8 v0, v0, 0x1

    return v0
.end method

.method public b()Lcom/moji/lottie/BaseKeyframeAnimation;
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Lcom/moji/lottie/BaseKeyframeAnimation<",
            "*",
            "Landroid/graphics/PointF;",
            ">;"
        }
    .end annotation

    .line 60
    invoke-virtual {p0}, Lcom/moji/lottie/AnimatablePathValue;->a()Z

    move-result v0

    if-nez v0, :cond_0

    .line 61
    new-instance v0, Lcom/moji/lottie/StaticKeyframeAnimation;

    iget-object v1, p0, Lcom/moji/lottie/AnimatablePathValue;->b:Landroid/graphics/PointF;

    invoke-direct {v0, v1}, Lcom/moji/lottie/StaticKeyframeAnimation;-><init>(Ljava/lang/Object;)V

    return-object v0

    .line 64
    :cond_0
    new-instance v0, Lcom/moji/lottie/PathKeyframeAnimation;

    iget-object v1, p0, Lcom/moji/lottie/AnimatablePathValue;->a:Ljava/util/List;

    invoke-direct {v0, v1}, Lcom/moji/lottie/PathKeyframeAnimation;-><init>(Ljava/util/List;)V

    return-object v0
.end method

.method public toString()Ljava/lang/String;
    .locals 2

    .line 74
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "initialPoint="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-object v1, p0, Lcom/moji/lottie/AnimatablePathValue;->b:Landroid/graphics/PointF;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method
