.class public Lcom/moji/lottie/LottieAnimationView;
.super Landroid/widget/ImageView;
.source "LottieAnimationView.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/lottie/LottieAnimationView$SavedState;,
        Lcom/moji/lottie/LottieAnimationView$CacheStrategy;
    }
.end annotation


# static fields
.field private static final a:Ljava/lang/String; = "LottieAnimationView"

.field private static final b:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Lcom/moji/lottie/LottieComposition;",
            ">;"
        }
    .end annotation
.end field

.field private static final c:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Ljava/lang/ref/WeakReference<",
            "Lcom/moji/lottie/LottieComposition;",
            ">;>;"
        }
    .end annotation
.end field


# instance fields
.field private final d:Lcom/moji/lottie/OnCompositionLoadedListener;

.field private final e:Lcom/moji/lottie/LottieDrawable;

.field private f:Lcom/moji/lottie/LottieAnimationView$CacheStrategy;

.field private g:Ljava/lang/String;

.field private h:Z

.field private i:Z

.field private j:Lcom/moji/lottie/Cancellable;
    .annotation build Landroid/support/annotation/Nullable;
    .end annotation
.end field

.field private k:Lcom/moji/lottie/LottieComposition;
    .annotation build Landroid/support/annotation/Nullable;
    .end annotation
.end field


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .line 58
    new-instance v0, Ljava/util/HashMap;

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

    sput-object v0, Lcom/moji/lottie/LottieAnimationView;->b:Ljava/util/Map;

    .line 59
    new-instance v0, Ljava/util/HashMap;

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

    sput-object v0, Lcom/moji/lottie/LottieAnimationView;->c:Ljava/util/Map;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .locals 0

    .line 86
    invoke-direct {p0, p1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    .line 62
    new-instance p1, Lcom/moji/lottie/LottieAnimationView$1;

    invoke-direct {p1, p0}, Lcom/moji/lottie/LottieAnimationView$1;-><init>(Lcom/moji/lottie/LottieAnimationView;)V

    iput-object p1, p0, Lcom/moji/lottie/LottieAnimationView;->d:Lcom/moji/lottie/OnCompositionLoadedListener;

    .line 71
    new-instance p1, Lcom/moji/lottie/LottieDrawable;

    invoke-direct {p1}, Lcom/moji/lottie/LottieDrawable;-><init>()V

    iput-object p1, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    const/4 p1, 0x0

    .line 74
    iput-boolean p1, p0, Lcom/moji/lottie/LottieAnimationView;->h:Z

    .line 75
    iput-boolean p1, p0, Lcom/moji/lottie/LottieAnimationView;->i:Z

    const/4 p1, 0x0

    .line 87
    invoke-direct {p0, p1}, Lcom/moji/lottie/LottieAnimationView;->a(Landroid/util/AttributeSet;)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 0

    .line 91
    invoke-direct {p0, p1, p2}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 62
    new-instance p1, Lcom/moji/lottie/LottieAnimationView$1;

    invoke-direct {p1, p0}, Lcom/moji/lottie/LottieAnimationView$1;-><init>(Lcom/moji/lottie/LottieAnimationView;)V

    iput-object p1, p0, Lcom/moji/lottie/LottieAnimationView;->d:Lcom/moji/lottie/OnCompositionLoadedListener;

    .line 71
    new-instance p1, Lcom/moji/lottie/LottieDrawable;

    invoke-direct {p1}, Lcom/moji/lottie/LottieDrawable;-><init>()V

    iput-object p1, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    const/4 p1, 0x0

    .line 74
    iput-boolean p1, p0, Lcom/moji/lottie/LottieAnimationView;->h:Z

    .line 75
    iput-boolean p1, p0, Lcom/moji/lottie/LottieAnimationView;->i:Z

    .line 92
    invoke-direct {p0, p2}, Lcom/moji/lottie/LottieAnimationView;->a(Landroid/util/AttributeSet;)V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 0

    .line 96
    invoke-direct {p0, p1, p2, p3}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 62
    new-instance p1, Lcom/moji/lottie/LottieAnimationView$1;

    invoke-direct {p1, p0}, Lcom/moji/lottie/LottieAnimationView$1;-><init>(Lcom/moji/lottie/LottieAnimationView;)V

    iput-object p1, p0, Lcom/moji/lottie/LottieAnimationView;->d:Lcom/moji/lottie/OnCompositionLoadedListener;

    .line 71
    new-instance p1, Lcom/moji/lottie/LottieDrawable;

    invoke-direct {p1}, Lcom/moji/lottie/LottieDrawable;-><init>()V

    iput-object p1, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    const/4 p1, 0x0

    .line 74
    iput-boolean p1, p0, Lcom/moji/lottie/LottieAnimationView;->h:Z

    .line 75
    iput-boolean p1, p0, Lcom/moji/lottie/LottieAnimationView;->i:Z

    .line 97
    invoke-direct {p0, p2}, Lcom/moji/lottie/LottieAnimationView;->a(Landroid/util/AttributeSet;)V

    return-void
.end method

.method static synthetic a(Lcom/moji/lottie/LottieAnimationView;Lcom/moji/lottie/Cancellable;)Lcom/moji/lottie/Cancellable;
    .locals 0

    .line 44
    iput-object p1, p0, Lcom/moji/lottie/LottieAnimationView;->j:Lcom/moji/lottie/Cancellable;

    return-object p1
.end method

.method private a(Landroid/util/AttributeSet;)V
    .locals 4
    .param p1    # Landroid/util/AttributeSet;
        .annotation build Landroid/support/annotation/Nullable;
        .end annotation
    .end param

    .line 101
    invoke-virtual {p0}, Lcom/moji/lottie/LottieAnimationView;->getContext()Landroid/content/Context;

    move-result-object v0

    sget-object v1, Lcom/moji/lottie/R$styleable;->LottieAnimationView:[I

    invoke-virtual {v0, p1, v1}, Landroid/content/Context;->obtainStyledAttributes(Landroid/util/AttributeSet;[I)Landroid/content/res/TypedArray;

    move-result-object p1

    .line 102
    sget v0, Lcom/moji/lottie/R$styleable;->LottieAnimationView_lottie_fileName:I

    invoke-virtual {p1, v0}, Landroid/content/res/TypedArray;->getString(I)Ljava/lang/String;

    move-result-object v0

    .line 103
    invoke-virtual {p0}, Lcom/moji/lottie/LottieAnimationView;->isInEditMode()Z

    move-result v1

    if-nez v1, :cond_0

    if-eqz v0, :cond_0

    .line 104
    invoke-virtual {p0, v0}, Lcom/moji/lottie/LottieAnimationView;->setAnimation(Ljava/lang/String;)V

    .line 106
    :cond_0
    sget v0, Lcom/moji/lottie/R$styleable;->LottieAnimationView_lottie_autoPlay:I

    const/4 v1, 0x0

    invoke-virtual {p1, v0, v1}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z

    move-result v0

    const/4 v2, 0x1

    if-eqz v0, :cond_1

    .line 107
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0}, Lcom/moji/lottie/LottieDrawable;->f()V

    .line 108
    iput-boolean v2, p0, Lcom/moji/lottie/LottieAnimationView;->i:Z

    .line 110
    :cond_1
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    sget v3, Lcom/moji/lottie/R$styleable;->LottieAnimationView_lottie_loop:I

    invoke-virtual {p1, v3, v1}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z

    move-result v3

    invoke-virtual {v0, v3}, Lcom/moji/lottie/LottieDrawable;->b(Z)V

    .line 111
    sget v0, Lcom/moji/lottie/R$styleable;->LottieAnimationView_lottie_imageAssetsFolder:I

    invoke-virtual {p1, v0}, Landroid/content/res/TypedArray;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/moji/lottie/LottieAnimationView;->setImageAssetsFolder(Ljava/lang/String;)V

    .line 112
    sget v0, Lcom/moji/lottie/R$styleable;->LottieAnimationView_lottie_progress:I

    const/4 v3, 0x0

    invoke-virtual {p1, v0, v3}, Landroid/content/res/TypedArray;->getFloat(IF)F

    move-result v0

    invoke-virtual {p0, v0}, Lcom/moji/lottie/LottieAnimationView;->setProgress(F)V

    .line 113
    sget v0, Lcom/moji/lottie/R$styleable;->LottieAnimationView_lottie_enableMergePathsForKitKatAndAbove:I

    invoke-virtual {p1, v0, v1}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z

    move-result v0

    invoke-virtual {p0, v0}, Lcom/moji/lottie/LottieAnimationView;->a(Z)V

    .line 115
    sget v0, Lcom/moji/lottie/R$styleable;->LottieAnimationView_lottie_cacheStrategy:I

    sget-object v1, Lcom/moji/lottie/LottieAnimationView$CacheStrategy;->None:Lcom/moji/lottie/LottieAnimationView$CacheStrategy;

    .line 117
    invoke-virtual {v1}, Lcom/moji/lottie/LottieAnimationView$CacheStrategy;->ordinal()I

    move-result v1

    .line 115
    invoke-virtual {p1, v0, v1}, Landroid/content/res/TypedArray;->getInt(II)I

    move-result v0

    .line 118
    invoke-static {}, Lcom/moji/lottie/LottieAnimationView$CacheStrategy;->values()[Lcom/moji/lottie/LottieAnimationView$CacheStrategy;

    move-result-object v1

    aget-object v0, v1, v0

    iput-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->f:Lcom/moji/lottie/LottieAnimationView$CacheStrategy;

    .line 119
    invoke-virtual {p1}, Landroid/content/res/TypedArray;->recycle()V

    const/4 p1, 0x0

    .line 120
    invoke-virtual {p0, v2, p1}, Lcom/moji/lottie/LottieAnimationView;->setLayerType(ILandroid/graphics/Paint;)V

    .line 122
    sget p1, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v0, 0x11

    if-lt p1, v0, :cond_2

    .line 123
    invoke-virtual {p0}, Lcom/moji/lottie/LottieAnimationView;->getContext()Landroid/content/Context;

    move-result-object p1

    invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object p1

    const-string v0, "animator_duration_scale"

    const/high16 v1, 0x3f800000    # 1.0f

    invoke-static {p1, v0, v1}, Landroid/provider/Settings$Global;->getFloat(Landroid/content/ContentResolver;Ljava/lang/String;F)F

    move-result p1

    cmpl-float p1, p1, v3

    if-nez p1, :cond_2

    .line 126
    iget-object p1, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {p1}, Lcom/moji/lottie/LottieDrawable;->c()V

    :cond_2
    return-void
.end method

.method static synthetic f()Ljava/util/Map;
    .locals 1

    .line 44
    sget-object v0, Lcom/moji/lottie/LottieAnimationView;->b:Ljava/util/Map;

    return-object v0
.end method

.method static synthetic g()Ljava/util/Map;
    .locals 1

    .line 44
    sget-object v0, Lcom/moji/lottie/LottieAnimationView;->c:Ljava/util/Map;

    return-object v0
.end method

.method private h()V
    .locals 1

    .line 341
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->j:Lcom/moji/lottie/Cancellable;

    if-eqz v0, :cond_0

    .line 342
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->j:Lcom/moji/lottie/Cancellable;

    invoke-interface {v0}, Lcom/moji/lottie/Cancellable;->a()V

    const/4 v0, 0x0

    .line 343
    iput-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->j:Lcom/moji/lottie/Cancellable;

    :cond_0
    return-void
.end method


# virtual methods
.method a()V
    .locals 1
    .annotation build Landroid/support/annotation/VisibleForTesting;
    .end annotation

    .line 246
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    if-eqz v0, :cond_0

    .line 247
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0}, Lcom/moji/lottie/LottieDrawable;->b()V

    :cond_0
    return-void
.end method

.method public a(Landroid/animation/Animator$AnimatorListener;)V
    .locals 1

    .line 426
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0, p1}, Lcom/moji/lottie/LottieDrawable;->a(Landroid/animation/Animator$AnimatorListener;)V

    return-void
.end method

.method public a(Ljava/lang/String;Lcom/moji/lottie/LottieAnimationView$CacheStrategy;)V
    .locals 2

    .line 298
    iput-object p1, p0, Lcom/moji/lottie/LottieAnimationView;->g:Ljava/lang/String;

    .line 299
    sget-object v0, Lcom/moji/lottie/LottieAnimationView;->c:Ljava/util/Map;

    invoke-interface {v0, p1}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 300
    sget-object v0, Lcom/moji/lottie/LottieAnimationView;->c:Ljava/util/Map;

    invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/ref/WeakReference;

    .line 301
    invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v1

    if-eqz v1, :cond_1

    .line 302
    invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object p1

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

    invoke-virtual {p0, p1}, Lcom/moji/lottie/LottieAnimationView;->setComposition(Lcom/moji/lottie/LottieComposition;)V

    return-void

    .line 305
    :cond_0
    sget-object v0, Lcom/moji/lottie/LottieAnimationView;->b:Ljava/util/Map;

    invoke-interface {v0, p1}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 306
    sget-object p2, Lcom/moji/lottie/LottieAnimationView;->b:Ljava/util/Map;

    invoke-interface {p2, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

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

    invoke-virtual {p0, p1}, Lcom/moji/lottie/LottieAnimationView;->setComposition(Lcom/moji/lottie/LottieComposition;)V

    return-void

    .line 310
    :cond_1
    iput-object p1, p0, Lcom/moji/lottie/LottieAnimationView;->g:Ljava/lang/String;

    .line 311
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0}, Lcom/moji/lottie/LottieDrawable;->k()V

    .line 312
    invoke-direct {p0}, Lcom/moji/lottie/LottieAnimationView;->h()V

    .line 313
    invoke-virtual {p0}, Lcom/moji/lottie/LottieAnimationView;->getContext()Landroid/content/Context;

    move-result-object v0

    new-instance v1, Lcom/moji/lottie/LottieAnimationView$2;

    invoke-direct {v1, p0, p2, p1}, Lcom/moji/lottie/LottieAnimationView$2;-><init>(Lcom/moji/lottie/LottieAnimationView;Lcom/moji/lottie/LottieAnimationView$CacheStrategy;Ljava/lang/String;)V

    invoke-static {v0, p1, v1}, Lcom/moji/lottie/LottieComposition$Factory;->a(Landroid/content/Context;Ljava/lang/String;Lcom/moji/lottie/OnCompositionLoadedListener;)Lcom/moji/lottie/Cancellable;

    move-result-object p1

    iput-object p1, p0, Lcom/moji/lottie/LottieAnimationView;->j:Lcom/moji/lottie/Cancellable;

    return-void
.end method

.method public a(Z)V
    .locals 1

    .line 260
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0, p1}, Lcom/moji/lottie/LottieDrawable;->a(Z)V

    return-void
.end method

.method public b(Landroid/animation/Animator$AnimatorListener;)V
    .locals 1

    .line 431
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0, p1}, Lcom/moji/lottie/LottieDrawable;->b(Landroid/animation/Animator$AnimatorListener;)V

    return-void
.end method

.method public b(Z)V
    .locals 1

    .line 435
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0, p1}, Lcom/moji/lottie/LottieDrawable;->b(Z)V

    return-void
.end method

.method public b()Z
    .locals 1

    .line 439
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0}, Lcom/moji/lottie/LottieDrawable;->e()Z

    move-result v0

    return v0
.end method

.method public c()V
    .locals 1

    .line 443
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0}, Lcom/moji/lottie/LottieDrawable;->f()V

    return-void
.end method

.method public d()V
    .locals 1

    .line 493
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0}, Lcom/moji/lottie/LottieDrawable;->k()V

    return-void
.end method

.method public e()V
    .locals 2

    .line 497
    invoke-virtual {p0}, Lcom/moji/lottie/LottieAnimationView;->getProgress()F

    move-result v0

    .line 498
    iget-object v1, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v1}, Lcom/moji/lottie/LottieDrawable;->k()V

    .line 499
    invoke-virtual {p0, v0}, Lcom/moji/lottie/LottieAnimationView;->setProgress(F)V

    return-void
.end method

.method public getDuration()J
    .locals 2

    .line 511
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->k:Lcom/moji/lottie/LottieComposition;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->k:Lcom/moji/lottie/LottieComposition;

    invoke-virtual {v0}, Lcom/moji/lottie/LottieComposition;->b()J

    move-result-wide v0

    goto :goto_0

    :cond_0
    const-wide/16 v0, 0x0

    :goto_0
    return-wide v0
.end method

.method public getProgress()F
    .locals 1
    .annotation build Landroid/support/annotation/FloatRange;
    .end annotation

    .line 507
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0}, Lcom/moji/lottie/LottieDrawable;->h()F

    move-result v0

    return v0
.end method

.method public getScale()F
    .locals 1

    .line 489
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0}, Lcom/moji/lottie/LottieDrawable;->i()F

    move-result v0

    return v0
.end method

.method public invalidateDrawable(Landroid/graphics/drawable/Drawable;)V
    .locals 2
    .param p1    # Landroid/graphics/drawable/Drawable;
        .annotation build Landroid/support/annotation/NonNull;
        .end annotation
    .end param

    .line 183
    invoke-virtual {p0}, Lcom/moji/lottie/LottieAnimationView;->getDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object v0

    iget-object v1, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    if-ne v0, v1, :cond_0

    .line 186
    iget-object p1, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-super {p0, p1}, Landroid/widget/ImageView;->invalidateDrawable(Landroid/graphics/drawable/Drawable;)V

    goto :goto_0

    .line 189
    :cond_0
    invoke-super {p0, p1}, Landroid/widget/ImageView;->invalidateDrawable(Landroid/graphics/drawable/Drawable;)V

    :goto_0
    return-void
.end method

.method protected onAttachedToWindow()V
    .locals 1

    .line 226
    invoke-super {p0}, Landroid/widget/ImageView;->onAttachedToWindow()V

    .line 227
    iget-boolean v0, p0, Lcom/moji/lottie/LottieAnimationView;->i:Z

    if-eqz v0, :cond_0

    iget-boolean v0, p0, Lcom/moji/lottie/LottieAnimationView;->h:Z

    if-eqz v0, :cond_0

    .line 228
    invoke-virtual {p0}, Lcom/moji/lottie/LottieAnimationView;->c()V

    :cond_0
    return-void
.end method

.method protected onDetachedFromWindow()V
    .locals 1

    .line 234
    invoke-virtual {p0}, Lcom/moji/lottie/LottieAnimationView;->b()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 235
    invoke-virtual {p0}, Lcom/moji/lottie/LottieAnimationView;->d()V

    const/4 v0, 0x1

    .line 236
    iput-boolean v0, p0, Lcom/moji/lottie/LottieAnimationView;->h:Z

    .line 238
    :cond_0
    invoke-virtual {p0}, Lcom/moji/lottie/LottieAnimationView;->a()V

    .line 239
    invoke-super {p0}, Landroid/widget/ImageView;->onDetachedFromWindow()V

    return-void
.end method

.method protected onRestoreInstanceState(Landroid/os/Parcelable;)V
    .locals 1

    .line 206
    instance-of v0, p1, Lcom/moji/lottie/LottieAnimationView$SavedState;

    if-nez v0, :cond_0

    .line 207
    invoke-super {p0, p1}, Landroid/widget/ImageView;->onRestoreInstanceState(Landroid/os/Parcelable;)V

    return-void

    .line 211
    :cond_0
    check-cast p1, Lcom/moji/lottie/LottieAnimationView$SavedState;

    .line 212
    invoke-virtual {p1}, Lcom/moji/lottie/LottieAnimationView$SavedState;->getSuperState()Landroid/os/Parcelable;

    move-result-object v0

    invoke-super {p0, v0}, Landroid/widget/ImageView;->onRestoreInstanceState(Landroid/os/Parcelable;)V

    .line 213
    iget-object v0, p1, Lcom/moji/lottie/LottieAnimationView$SavedState;->animationName:Ljava/lang/String;

    iput-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->g:Ljava/lang/String;

    .line 214
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->g:Ljava/lang/String;

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_1

    .line 215
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->g:Ljava/lang/String;

    invoke-virtual {p0, v0}, Lcom/moji/lottie/LottieAnimationView;->setAnimation(Ljava/lang/String;)V

    .line 217
    :cond_1
    iget v0, p1, Lcom/moji/lottie/LottieAnimationView$SavedState;->progress:F

    invoke-virtual {p0, v0}, Lcom/moji/lottie/LottieAnimationView;->setProgress(F)V

    .line 218
    iget-boolean v0, p1, Lcom/moji/lottie/LottieAnimationView$SavedState;->isLooping:Z

    invoke-virtual {p0, v0}, Lcom/moji/lottie/LottieAnimationView;->b(Z)V

    .line 219
    iget-boolean p1, p1, Lcom/moji/lottie/LottieAnimationView$SavedState;->isAnimating:Z

    if-eqz p1, :cond_2

    .line 220
    invoke-virtual {p0}, Lcom/moji/lottie/LottieAnimationView;->c()V

    :cond_2
    return-void
.end method

.method protected onSaveInstanceState()Landroid/os/Parcelable;
    .locals 2

    .line 195
    invoke-super {p0}, Landroid/widget/ImageView;->onSaveInstanceState()Landroid/os/Parcelable;

    move-result-object v0

    .line 196
    new-instance v1, Lcom/moji/lottie/LottieAnimationView$SavedState;

    invoke-direct {v1, v0}, Lcom/moji/lottie/LottieAnimationView$SavedState;-><init>(Landroid/os/Parcelable;)V

    .line 197
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->g:Ljava/lang/String;

    iput-object v0, v1, Lcom/moji/lottie/LottieAnimationView$SavedState;->animationName:Ljava/lang/String;

    .line 198
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0}, Lcom/moji/lottie/LottieDrawable;->h()F

    move-result v0

    iput v0, v1, Lcom/moji/lottie/LottieAnimationView$SavedState;->progress:F

    .line 199
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0}, Lcom/moji/lottie/LottieDrawable;->e()Z

    move-result v0

    iput-boolean v0, v1, Lcom/moji/lottie/LottieAnimationView$SavedState;->isAnimating:Z

    .line 200
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0}, Lcom/moji/lottie/LottieDrawable;->d()Z

    move-result v0

    iput-boolean v0, v1, Lcom/moji/lottie/LottieAnimationView$SavedState;->isLooping:Z

    return-object v1
.end method

.method public setAnimation(Ljava/lang/String;)V
    .locals 1

    .line 286
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->f:Lcom/moji/lottie/LottieAnimationView$CacheStrategy;

    invoke-virtual {p0, p1, v0}, Lcom/moji/lottie/LottieAnimationView;->a(Ljava/lang/String;Lcom/moji/lottie/LottieAnimationView$CacheStrategy;)V

    return-void
.end method

.method public setAnimation(Lorg/json/JSONObject;)V
    .locals 2

    .line 336
    invoke-direct {p0}, Lcom/moji/lottie/LottieAnimationView;->h()V

    .line 337
    invoke-virtual {p0}, Lcom/moji/lottie/LottieAnimationView;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    iget-object v1, p0, Lcom/moji/lottie/LottieAnimationView;->d:Lcom/moji/lottie/OnCompositionLoadedListener;

    invoke-static {v0, p1, v1}, Lcom/moji/lottie/LottieComposition$Factory;->a(Landroid/content/res/Resources;Lorg/json/JSONObject;Lcom/moji/lottie/OnCompositionLoadedListener;)Lcom/moji/lottie/Cancellable;

    move-result-object p1

    iput-object p1, p0, Lcom/moji/lottie/LottieAnimationView;->j:Lcom/moji/lottie/Cancellable;

    return-void
.end method

.method public setComposition(Lcom/moji/lottie/LottieComposition;)V
    .locals 8
    .param p1    # Lcom/moji/lottie/LottieComposition;
        .annotation build Landroid/support/annotation/NonNull;
        .end annotation
    .end param

    .line 356
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0, p0}, Lcom/moji/lottie/LottieDrawable;->setCallback(Landroid/graphics/drawable/Drawable$Callback;)V

    .line 358
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0, p1}, Lcom/moji/lottie/LottieDrawable;->a(Lcom/moji/lottie/LottieComposition;)Z

    move-result v0

    if-nez v0, :cond_0

    return-void

    .line 365
    :cond_0
    invoke-virtual {p0}, Lcom/moji/lottie/LottieAnimationView;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Lcom/moji/lottie/Utils;->a(Landroid/content/Context;)I

    move-result v0

    .line 366
    invoke-virtual {p0}, Lcom/moji/lottie/LottieAnimationView;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-static {v1}, Lcom/moji/lottie/Utils;->b(Landroid/content/Context;)I

    move-result v1

    .line 367
    invoke-virtual {p1}, Lcom/moji/lottie/LottieComposition;->a()Landroid/graphics/Rect;

    move-result-object v2

    invoke-virtual {v2}, Landroid/graphics/Rect;->width()I

    move-result v2

    .line 368
    invoke-virtual {p1}, Lcom/moji/lottie/LottieComposition;->a()Landroid/graphics/Rect;

    move-result-object v3

    invoke-virtual {v3}, Landroid/graphics/Rect;->height()I

    move-result v3

    if-gt v2, v0, :cond_1

    if-le v3, v1, :cond_2

    :cond_1
    int-to-float v4, v0

    int-to-float v5, v2

    div-float/2addr v4, v5

    int-to-float v5, v1

    int-to-float v6, v3

    div-float/2addr v5, v6

    .line 373
    invoke-static {v4, v5}, Ljava/lang/Math;->min(FF)F

    move-result v4

    invoke-virtual {p0, v4}, Lcom/moji/lottie/LottieAnimationView;->setScale(F)V

    const-string v4, "LOTTIE"

    const-string v5, "Composition larger than the screen %dx%d vs %dx%d. Scaling down."

    const/4 v6, 0x4

    .line 374
    new-array v6, v6, [Ljava/lang/Object;

    const/4 v7, 0x0

    .line 376
    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    aput-object v2, v6, v7

    const/4 v2, 0x1

    invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    aput-object v3, v6, v2

    const/4 v2, 0x2

    invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    aput-object v0, v6, v2

    const/4 v0, 0x3

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    aput-object v1, v6, v0

    .line 374
    invoke-static {v5, v6}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v4, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    :cond_2
    const/4 v0, 0x0

    .line 382
    invoke-virtual {p0, v0}, Lcom/moji/lottie/LottieAnimationView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 383
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {p0, v0}, Lcom/moji/lottie/LottieAnimationView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 385
    iput-object p1, p0, Lcom/moji/lottie/LottieAnimationView;->k:Lcom/moji/lottie/LottieComposition;

    .line 387
    invoke-virtual {p0}, Lcom/moji/lottie/LottieAnimationView;->requestLayout()V

    return-void
.end method

.method public setImageAssetDelegate(Lcom/moji/lottie/ImageAssetDelegate;)V
    .locals 1

    .line 468
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0, p1}, Lcom/moji/lottie/LottieDrawable;->a(Lcom/moji/lottie/ImageAssetDelegate;)V

    return-void
.end method

.method public setImageAssetsFolder(Ljava/lang/String;)V
    .locals 1

    .line 413
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0, p1}, Lcom/moji/lottie/LottieDrawable;->a(Ljava/lang/String;)V

    return-void
.end method

.method public setImageDrawable(Landroid/graphics/drawable/Drawable;)V
    .locals 1

    .line 139
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    if-eq p1, v0, :cond_0

    .line 140
    invoke-virtual {p0}, Lcom/moji/lottie/LottieAnimationView;->a()V

    .line 142
    :cond_0
    invoke-super {p0, p1}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    return-void
.end method

.method public setImageResource(I)V
    .locals 0

    .line 133
    invoke-super {p0, p1}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 134
    invoke-virtual {p0}, Lcom/moji/lottie/LottieAnimationView;->a()V

    return-void
.end method

.method public setProgress(F)V
    .locals 1
    .param p1    # F
        .annotation build Landroid/support/annotation/FloatRange;
        .end annotation
    .end param

    .line 503
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0, p1}, Lcom/moji/lottie/LottieDrawable;->b(F)V

    return-void
.end method

.method public setScale(F)V
    .locals 1

    .line 481
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0, p1}, Lcom/moji/lottie/LottieDrawable;->c(F)V

    .line 482
    invoke-virtual {p0}, Lcom/moji/lottie/LottieAnimationView;->getDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object p1

    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    if-ne p1, v0, :cond_0

    const/4 p1, 0x0

    .line 483
    invoke-virtual {p0, p1}, Lcom/moji/lottie/LottieAnimationView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 484
    iget-object p1, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {p0, p1}, Lcom/moji/lottie/LottieAnimationView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    :cond_0
    return-void
.end method

.method public setSpeed(F)V
    .locals 1

    .line 459
    iget-object v0, p0, Lcom/moji/lottie/LottieAnimationView;->e:Lcom/moji/lottie/LottieDrawable;

    invoke-virtual {v0, p1}, Lcom/moji/lottie/LottieDrawable;->a(F)V

    return-void
.end method
