SVGAImageView.smali
.class public Lcom/opensource/svgaplayer/SVGAImageView;
.super Landroid/widget/ImageView;
.source "SVGAImageView.kt"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/opensource/svgaplayer/SVGAImageView$FillMode;
}
.end annotation
# instance fields
.field private _$_findViewCache:Ljava/util/HashMap;
.field private animator:Landroid/animation/ValueAnimator;
.field private callback:Lcom/opensource/svgaplayer/b;
.field private clearsAfterStop:Z
.field private fillMode:Lcom/opensource/svgaplayer/SVGAImageView$FillMode;
.field private isAnimating:Z
.field private loops:I
.field private mItemClickAreaListener:Lcom/opensource/svgaplayer/SVGAClickAreaListener;
.field private mVideoItem:Lcom/opensource/svgaplayer/q;
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.registers 2
.line 1
invoke-direct {p0, p1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V
const/4 p1, 0x1
.line 2
iput-boolean p1, p0, Lcom/opensource/svgaplayer/SVGAImageView;->clearsAfterStop:Z
.line 3
sget-object p1, Lcom/opensource/svgaplayer/SVGAImageView$FillMode;->Forward:Lcom/opensource/svgaplayer/SVGAImageView$FillMode;
iput-object p1, p0, Lcom/opensource/svgaplayer/SVGAImageView;->fillMode:Lcom/opensource/svgaplayer/SVGAImageView$FillMode;
.line 4
invoke-direct {p0}, Lcom/opensource/svgaplayer/SVGAImageView;->setSoftwareLayerType()V
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.registers 3
.line 5
invoke-direct {p0, p1, p2}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
const/4 p1, 0x1
.line 6
iput-boolean p1, p0, Lcom/opensource/svgaplayer/SVGAImageView;->clearsAfterStop:Z
.line 7
sget-object p1, Lcom/opensource/svgaplayer/SVGAImageView$FillMode;->Forward:Lcom/opensource/svgaplayer/SVGAImageView$FillMode;
iput-object p1, p0, Lcom/opensource/svgaplayer/SVGAImageView;->fillMode:Lcom/opensource/svgaplayer/SVGAImageView$FillMode;
.line 8
invoke-direct {p0}, Lcom/opensource/svgaplayer/SVGAImageView;->setSoftwareLayerType()V
if-eqz p2, :cond_12
.line 9
invoke-direct {p0, p2}, Lcom/opensource/svgaplayer/SVGAImageView;->loadAttrs(Landroid/util/AttributeSet;)V
:cond_12
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
.registers 4
.line 10
invoke-direct {p0, p1, p2, p3}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
const/4 p1, 0x1
.line 11
iput-boolean p1, p0, Lcom/opensource/svgaplayer/SVGAImageView;->clearsAfterStop:Z
.line 12
sget-object p1, Lcom/opensource/svgaplayer/SVGAImageView$FillMode;->Forward:Lcom/opensource/svgaplayer/SVGAImageView$FillMode;
iput-object p1, p0, Lcom/opensource/svgaplayer/SVGAImageView;->fillMode:Lcom/opensource/svgaplayer/SVGAImageView$FillMode;
.line 13
invoke-direct {p0}, Lcom/opensource/svgaplayer/SVGAImageView;->setSoftwareLayerType()V
if-eqz p2, :cond_12
.line 14
invoke-direct {p0, p2}, Lcom/opensource/svgaplayer/SVGAImageView;->loadAttrs(Landroid/util/AttributeSet;)V
:cond_12
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V
.registers 5
.line 15
invoke-direct {p0, p1, p2, p3, p4}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V
const/4 p1, 0x1
.line 16
iput-boolean p1, p0, Lcom/opensource/svgaplayer/SVGAImageView;->clearsAfterStop:Z
.line 17
sget-object p1, Lcom/opensource/svgaplayer/SVGAImageView$FillMode;->Forward:Lcom/opensource/svgaplayer/SVGAImageView$FillMode;
iput-object p1, p0, Lcom/opensource/svgaplayer/SVGAImageView;->fillMode:Lcom/opensource/svgaplayer/SVGAImageView$FillMode;
.line 18
invoke-direct {p0}, Lcom/opensource/svgaplayer/SVGAImageView;->setSoftwareLayerType()V
if-eqz p2, :cond_12
.line 19
invoke-direct {p0, p2}, Lcom/opensource/svgaplayer/SVGAImageView;->loadAttrs(Landroid/util/AttributeSet;)V
:cond_12
return-void
.end method
.method public static final synthetic access$isAnimating$p(Lcom/opensource/svgaplayer/SVGAImageView;)Z
.registers 1
.line 1
iget-boolean p0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->isAnimating:Z
return p0
.end method
.method public static final synthetic access$setAnimating$p(Lcom/opensource/svgaplayer/SVGAImageView;Z)V
.registers 2
.line 1
iput-boolean p1, p0, Lcom/opensource/svgaplayer/SVGAImageView;->isAnimating:Z
return-void
.end method
.method private final clearAudio()V
.registers 5
.line 1
iget-object v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->mVideoItem:Lcom/opensource/svgaplayer/q;
if-eqz v0, :cond_36
invoke-virtual {v0}, Lcom/opensource/svgaplayer/q;->b()Ljava/util/List;
move-result-object v0
if-eqz v0, :cond_36
.line 2
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
move-result-object v0
:goto_e
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_36
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lcom/opensource/svgaplayer/entities/a;
.line 3
invoke-virtual {v1}, Lcom/opensource/svgaplayer/entities/a;->b()Ljava/lang/Integer;
move-result-object v2
if-eqz v2, :cond_31
invoke-virtual {v2}, Ljava/lang/Integer;->intValue()I
move-result v2
.line 4
iget-object v3, p0, Lcom/opensource/svgaplayer/SVGAImageView;->mVideoItem:Lcom/opensource/svgaplayer/q;
if-eqz v3, :cond_31
invoke-virtual {v3}, Lcom/opensource/svgaplayer/q;->f()Landroid/media/SoundPool;
move-result-object v3
if-eqz v3, :cond_31
invoke-virtual {v3, v2}, Landroid/media/SoundPool;->stop(I)V
:cond_31
const/4 v2, 0x0
.line 5
invoke-virtual {v1, v2}, Lcom/opensource/svgaplayer/entities/a;->a(Ljava/lang/Integer;)V
goto :goto_e
:cond_36
return-void
.end method
.method private final loadAttrs(Landroid/util/AttributeSet;)V
.registers 10
.line 1
invoke-virtual {p0}, Landroid/widget/ImageView;->getContext()Landroid/content/Context;
move-result-object v0
const-string v1, "context"
invoke-static {v0, v1}, Lkotlin/jvm/internal/i;->a(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v0}, Landroid/content/Context;->getTheme()Landroid/content/res/Resources$Theme;
move-result-object v0
sget-object v1, Lcom/opensource/svgaplayer/R$styleable;->SVGAImageView:[I
const/4 v2, 0x0
invoke-virtual {v0, p1, v1, v2, v2}, Landroid/content/res/Resources$Theme;->obtainStyledAttributes(Landroid/util/AttributeSet;[III)Landroid/content/res/TypedArray;
move-result-object p1
.line 2
sget v0, Lcom/opensource/svgaplayer/R$styleable;->SVGAImageView_loopCount:I
invoke-virtual {p1, v0, v2}, Landroid/content/res/TypedArray;->getInt(II)I
move-result v0
iput v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->loops:I
.line 3
sget v0, Lcom/opensource/svgaplayer/R$styleable;->SVGAImageView_clearsAfterStop:I
const/4 v1, 0x1
invoke-virtual {p1, v0, v1}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z
move-result v0
iput-boolean v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->clearsAfterStop:Z
.line 4
sget v0, Lcom/opensource/svgaplayer/R$styleable;->SVGAImageView_antiAlias:I
invoke-virtual {p1, v0, v1}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z
move-result v6
.line 5
sget v0, Lcom/opensource/svgaplayer/R$styleable;->SVGAImageView_autoPlay:I
invoke-virtual {p1, v0, v1}, Landroid/content/res/TypedArray;->getBoolean(IZ)Z
move-result v7
.line 6
sget v0, Lcom/opensource/svgaplayer/R$styleable;->SVGAImageView_fillMode:I
invoke-virtual {p1, v0}, Landroid/content/res/TypedArray;->getString(I)Ljava/lang/String;
move-result-object v0
if-eqz v0, :cond_52
const-string v1, "0"
.line 7
invoke-static {v0, v1}, Lkotlin/jvm/internal/i;->a(Ljava/lang/Object;Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_46
.line 8
sget-object v0, Lcom/opensource/svgaplayer/SVGAImageView$FillMode;->Backward:Lcom/opensource/svgaplayer/SVGAImageView$FillMode;
iput-object v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->fillMode:Lcom/opensource/svgaplayer/SVGAImageView$FillMode;
goto :goto_52
:cond_46
const-string v1, "1"
.line 9
invoke-static {v0, v1}, Lkotlin/jvm/internal/i;->a(Ljava/lang/Object;Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_52
.line 10
sget-object v0, Lcom/opensource/svgaplayer/SVGAImageView$FillMode;->Forward:Lcom/opensource/svgaplayer/SVGAImageView$FillMode;
iput-object v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->fillMode:Lcom/opensource/svgaplayer/SVGAImageView$FillMode;
.line 11
:cond_52
:goto_52
sget v0, Lcom/opensource/svgaplayer/R$styleable;->SVGAImageView_source:I
invoke-virtual {p1, v0}, Landroid/content/res/TypedArray;->getString(I)Ljava/lang/String;
move-result-object v3
if-eqz v3, :cond_72
.line 12
new-instance v4, Lcom/opensource/svgaplayer/SVGAParser;
invoke-virtual {p0}, Landroid/widget/ImageView;->getContext()Landroid/content/Context;
move-result-object v0
invoke-direct {v4, v0}, Lcom/opensource/svgaplayer/SVGAParser;-><init>(Landroid/content/Context;)V
.line 13
new-instance v0, Ljava/lang/Thread;
new-instance v1, Lcom/opensource/svgaplayer/g;
move-object v2, v1
move-object v5, p0
invoke-direct/range {v2 .. v7}, Lcom/opensource/svgaplayer/g;-><init>(Ljava/lang/String;Lcom/opensource/svgaplayer/SVGAParser;Lcom/opensource/svgaplayer/SVGAImageView;ZZ)V
invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V
.line 14
invoke-virtual {v0}, Ljava/lang/Thread;->start()V
.line 15
:cond_72
invoke-virtual {p1}, Landroid/content/res/TypedArray;->recycle()V
return-void
.end method
.method private final setAnimating(Z)V
.registers 2
.line 1
iput-boolean p1, p0, Lcom/opensource/svgaplayer/SVGAImageView;->isAnimating:Z
return-void
.end method
.method private final setSoftwareLayerType()V
.registers 3
.line 1
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
const/16 v1, 0x12
if-ge v0, v1, :cond_b
const/4 v0, 0x1
const/4 v1, 0x0
.line 2
invoke-virtual {p0, v0, v1}, Landroid/widget/ImageView;->setLayerType(ILandroid/graphics/Paint;)V
:cond_b
return-void
.end method
.method public static synthetic startAnimation$default(Lcom/opensource/svgaplayer/SVGAImageView;Lcom/opensource/svgaplayer/b/b;ZILjava/lang/Object;)V
.registers 5
if-nez p4, :cond_b
and-int/lit8 p3, p3, 0x2
if-eqz p3, :cond_7
const/4 p2, 0x0
.line 1
:cond_7
invoke-virtual {p0, p1, p2}, Lcom/opensource/svgaplayer/SVGAImageView;->startAnimation(Lcom/opensource/svgaplayer/b/b;Z)V
return-void
.line 2
:cond_b
new-instance p0, Ljava/lang/UnsupportedOperationException;
const-string p1, "Super calls with default arguments not supported in this target, function: startAnimation"
invoke-direct {p0, p1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V
throw p0
.end method
# virtual methods
.method public _$_clearFindViewByIdCache()V
.registers 2
iget-object v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->_$_findViewCache:Ljava/util/HashMap;
if-eqz v0, :cond_7
invoke-virtual {v0}, Ljava/util/HashMap;->clear()V
:cond_7
return-void
.end method
.method public _$_findCachedViewById(I)Landroid/view/View;
.registers 4
iget-object v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->_$_findViewCache:Ljava/util/HashMap;
if-nez v0, :cond_b
new-instance v0, Ljava/util/HashMap;
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
iput-object v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->_$_findViewCache:Ljava/util/HashMap;
:cond_b
iget-object v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->_$_findViewCache:Ljava/util/HashMap;
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/view/View;
if-nez v0, :cond_26
invoke-virtual {p0, p1}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v0
iget-object v1, p0, Lcom/opensource/svgaplayer/SVGAImageView;->_$_findViewCache:Ljava/util/HashMap;
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object p1
invoke-virtual {v1, p1, v0}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
:cond_26
return-object v0
.end method
.method public final getCallback()Lcom/opensource/svgaplayer/b;
.registers 2
.line 1
iget-object v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->callback:Lcom/opensource/svgaplayer/b;
return-object v0
.end method
.method public final getClearsAfterStop()Z
.registers 2
.line 1
iget-boolean v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->clearsAfterStop:Z
return v0
.end method
.method public final getFillMode()Lcom/opensource/svgaplayer/SVGAImageView$FillMode;
.registers 2
.line 1
iget-object v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->fillMode:Lcom/opensource/svgaplayer/SVGAImageView$FillMode;
return-object v0
.end method
.method public final getLoops()I
.registers 2
.line 1
iget v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->loops:I
return v0
.end method
.method public final isAnimating()Z
.registers 2
.line 1
iget-boolean v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->isAnimating:Z
return v0
.end method
.method protected onDetachedFromWindow()V
.registers 2
.line 1
invoke-super {p0}, Landroid/widget/ImageView;->onDetachedFromWindow()V
.line 2
invoke-direct {p0}, Lcom/opensource/svgaplayer/SVGAImageView;->clearAudio()V
.line 3
iget-object v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->animator:Landroid/animation/ValueAnimator;
if-eqz v0, :cond_d
invoke-virtual {v0}, Landroid/animation/ValueAnimator;->cancel()V
.line 4
:cond_d
iget-object v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->animator:Landroid/animation/ValueAnimator;
if-eqz v0, :cond_14
invoke-virtual {v0}, Landroid/animation/ValueAnimator;->removeAllListeners()V
.line 5
:cond_14
iget-object v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->animator:Landroid/animation/ValueAnimator;
if-eqz v0, :cond_1b
invoke-virtual {v0}, Landroid/animation/ValueAnimator;->removeAllUpdateListeners()V
:cond_1b
return-void
.end method
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
.registers 9
.annotation build Landroid/annotation/SuppressLint;
value = {
"ClickableViewAccessibility"
}
.end annotation
if-eqz p1, :cond_76
.line 1
invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I
move-result v0
if-nez v0, :cond_76
.line 2
invoke-virtual {p0}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;
move-result-object v0
instance-of v1, v0, Lcom/opensource/svgaplayer/c;
if-nez v1, :cond_11
const/4 v0, 0x0
:cond_11
check-cast v0, Lcom/opensource/svgaplayer/c;
const/4 v1, 0x0
if-eqz v0, :cond_75
.line 3
invoke-virtual {v0}, Lcom/opensource/svgaplayer/c;->b()Lcom/opensource/svgaplayer/d;
move-result-object v0
invoke-virtual {v0}, Lcom/opensource/svgaplayer/d;->j()Ljava/util/HashMap;
move-result-object v0
invoke-interface {v0}, Ljava/util/Map;->entrySet()Ljava/util/Set;
move-result-object v0
invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
move-result-object v0
:cond_26
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_76
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Ljava/util/Map$Entry;
invoke-interface {v2}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
move-result-object v3
check-cast v3, Ljava/lang/String;
invoke-interface {v2}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
move-result-object v2
check-cast v2, [I
.line 4
invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F
move-result v4
aget v5, v2, v1
int-to-float v5, v5
cmpl-float v4, v4, v5
if-ltz v4, :cond_26
invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F
move-result v4
const/4 v5, 0x2
aget v5, v2, v5
int-to-float v5, v5
cmpg-float v4, v4, v5
if-gtz v4, :cond_26
invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F
move-result v4
const/4 v5, 0x1
aget v6, v2, v5
int-to-float v6, v6
cmpl-float v4, v4, v6
if-ltz v4, :cond_26
invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F
move-result v4
const/4 v6, 0x3
aget v2, v2, v6
int-to-float v2, v2
cmpg-float v2, v4, v2
if-gtz v2, :cond_26
.line 5
iget-object v2, p0, Lcom/opensource/svgaplayer/SVGAImageView;->mItemClickAreaListener:Lcom/opensource/svgaplayer/SVGAClickAreaListener;
if-eqz v2, :cond_26
.line 6
invoke-interface {v2, v3}, Lcom/opensource/svgaplayer/SVGAClickAreaListener;->onClick(Ljava/lang/String;)V
return v5
:cond_75
return v1
.line 7
:cond_76
invoke-super {p0, p1}, Landroid/widget/ImageView;->onTouchEvent(Landroid/view/MotionEvent;)Z
move-result p1
return p1
.end method
.method public final pauseAnimation()V
.registers 2
const/4 v0, 0x0
.line 1
invoke-virtual {p0, v0}, Lcom/opensource/svgaplayer/SVGAImageView;->stopAnimation(Z)V
.line 2
iget-object v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->callback:Lcom/opensource/svgaplayer/b;
if-eqz v0, :cond_b
invoke-interface {v0}, Lcom/opensource/svgaplayer/b;->onPause()V
:cond_b
return-void
.end method
.method public final setCallback(Lcom/opensource/svgaplayer/b;)V
.registers 2
.line 1
iput-object p1, p0, Lcom/opensource/svgaplayer/SVGAImageView;->callback:Lcom/opensource/svgaplayer/b;
return-void
.end method
.method public final setClearsAfterStop(Z)V
.registers 2
.line 1
iput-boolean p1, p0, Lcom/opensource/svgaplayer/SVGAImageView;->clearsAfterStop:Z
return-void
.end method
.method public final setFillMode(Lcom/opensource/svgaplayer/SVGAImageView$FillMode;)V
.registers 3
const-string v0, "<set-?>"
invoke-static {p1, v0}, Lkotlin/jvm/internal/i;->d(Ljava/lang/Object;Ljava/lang/String;)V
.line 1
iput-object p1, p0, Lcom/opensource/svgaplayer/SVGAImageView;->fillMode:Lcom/opensource/svgaplayer/SVGAImageView$FillMode;
return-void
.end method
.method public final setLoops(I)V
.registers 2
.line 1
iput p1, p0, Lcom/opensource/svgaplayer/SVGAImageView;->loops:I
return-void
.end method
.method public final setOnAnimKeyClickListener(Lcom/opensource/svgaplayer/SVGAClickAreaListener;)V
.registers 3
const-string v0, "clickListener"
invoke-static {p1, v0}, Lkotlin/jvm/internal/i;->d(Ljava/lang/Object;Ljava/lang/String;)V
.line 1
iput-object p1, p0, Lcom/opensource/svgaplayer/SVGAImageView;->mItemClickAreaListener:Lcom/opensource/svgaplayer/SVGAClickAreaListener;
return-void
.end method
.method public final setVideoItem(Lcom/opensource/svgaplayer/q;)V
.registers 3
.line 1
new-instance v0, Lcom/opensource/svgaplayer/d;
invoke-direct {v0}, Lcom/opensource/svgaplayer/d;-><init>()V
invoke-virtual {p0, p1, v0}, Lcom/opensource/svgaplayer/SVGAImageView;->setVideoItem(Lcom/opensource/svgaplayer/q;Lcom/opensource/svgaplayer/d;)V
return-void
.end method
.method public final setVideoItem(Lcom/opensource/svgaplayer/q;Lcom/opensource/svgaplayer/d;)V
.registers 4
if-nez p1, :cond_7
const/4 p1, 0x0
.line 2
invoke-virtual {p0, p1}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V
return-void
.line 3
:cond_7
new-instance v0, Lcom/opensource/svgaplayer/c;
if-eqz p2, :cond_c
goto :goto_11
:cond_c
new-instance p2, Lcom/opensource/svgaplayer/d;
invoke-direct {p2}, Lcom/opensource/svgaplayer/d;-><init>()V
:goto_11
invoke-direct {v0, p1, p2}, Lcom/opensource/svgaplayer/c;-><init>(Lcom/opensource/svgaplayer/q;Lcom/opensource/svgaplayer/d;)V
.line 4
iget-boolean p2, p0, Lcom/opensource/svgaplayer/SVGAImageView;->clearsAfterStop:Z
invoke-virtual {v0, p2}, Lcom/opensource/svgaplayer/c;->a(Z)V
.line 5
invoke-virtual {p0, v0}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V
.line 6
iput-object p1, p0, Lcom/opensource/svgaplayer/SVGAImageView;->mVideoItem:Lcom/opensource/svgaplayer/q;
return-void
.end method
.method public final startAnimation()V
.registers 3
const/4 v0, 0x0
const/4 v1, 0x0
.line 1
invoke-virtual {p0, v0, v1}, Lcom/opensource/svgaplayer/SVGAImageView;->startAnimation(Lcom/opensource/svgaplayer/b/b;Z)V
return-void
.end method
.method public final startAnimation(Lcom/opensource/svgaplayer/b/b;Z)V
.registers 19
move-object/from16 v7, p0
const/4 v0, 0x0
.line 2
invoke-virtual {v7, v0}, Lcom/opensource/svgaplayer/SVGAImageView;->stopAnimation(Z)V
.line 3
invoke-virtual/range {p0 .. p0}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;
move-result-object v1
instance-of v2, v1, Lcom/opensource/svgaplayer/c;
const/4 v3, 0x0
if-nez v2, :cond_10
move-object v1, v3
:cond_10
move-object v6, v1
check-cast v6, Lcom/opensource/svgaplayer/c;
if-eqz v6, :cond_e3
.line 4
invoke-virtual {v6, v0}, Lcom/opensource/svgaplayer/c;->a(Z)V
.line 5
invoke-virtual/range {p0 .. p0}, Landroid/widget/ImageView;->getScaleType()Landroid/widget/ImageView$ScaleType;
move-result-object v1
const-string v2, "scaleType"
invoke-static {v1, v2}, Lkotlin/jvm/internal/i;->a(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v6, v1}, Lcom/opensource/svgaplayer/c;->a(Landroid/widget/ImageView$ScaleType;)V
.line 6
invoke-virtual {v6}, Lcom/opensource/svgaplayer/c;->c()Lcom/opensource/svgaplayer/q;
move-result-object v1
if-nez p1, :cond_df
.line 7
invoke-static {v0, v0}, Ljava/lang/Math;->max(II)I
move-result v8
.line 8
invoke-virtual {v1}, Lcom/opensource/svgaplayer/q;->d()I
move-result v2
const/4 v4, 0x1
sub-int/2addr v2, v4
if-nez p1, :cond_db
if-nez p1, :cond_d7
const v3, 0x7fffffff
add-int/2addr v3, v0
sub-int/2addr v3, v4
invoke-static {v2, v3}, Ljava/lang/Math;->min(II)I
move-result v9
const/4 v2, 0x2
.line 9
new-array v2, v2, [I
aput v8, v2, v0
aput v9, v2, v4
invoke-static {v2}, Landroid/animation/ValueAnimator;->ofInt([I)Landroid/animation/ValueAnimator;
move-result-object v10
const-string v0, "android.animation.ValueAnimator"
const-wide/high16 v2, 0x3ff0000000000000L # 1.0
.line 10
:try_start_50
invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
move-result-object v0
if-eqz v0, :cond_7a
const-string v5, "sDurationScale"
.line 11
invoke-virtual {v0, v5}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
move-result-object v5
if-eqz v5, :cond_7a
.line 12
invoke-virtual {v5, v4}, Ljava/lang/reflect/Field;->setAccessible(Z)V
.line 13
invoke-virtual {v5, v0}, Ljava/lang/reflect/Field;->getFloat(Ljava/lang/Object;)F
move-result v11
:try_end_65
.catch Ljava/lang/Exception; {:try_start_50 .. :try_end_65} :catch_7a
float-to-double v11, v11
const-wide/16 v13, 0x0
cmpg-double v15, v11, v13
if-nez v15, :cond_79
const/high16 v13, 0x3f800000 # 1.0f
.line 14
:try_start_6e
invoke-virtual {v5, v0, v13}, Ljava/lang/reflect/Field;->setFloat(Ljava/lang/Object;F)V
:try_end_71
.catch Ljava/lang/Exception; {:try_start_6e .. :try_end_71} :catch_79
:try_start_71
const-string v0, "SVGAPlayer"
const-string v5, "The animation duration scale has been reset to 1.0x, because you closed it on developer options."
.line 15
invoke-static {v0, v5}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
:try_end_78
.catch Ljava/lang/Exception; {:try_start_71 .. :try_end_78} :catch_7a
goto :goto_7a
:catch_79
:cond_79
move-wide v2, v11
:catch_7a
:cond_7a
:goto_7a
const-string v0, "animator"
.line 16
invoke-static {v10, v0}, Lkotlin/jvm/internal/i;->a(Ljava/lang/Object;Ljava/lang/String;)V
new-instance v0, Landroid/view/animation/LinearInterpolator;
invoke-direct {v0}, Landroid/view/animation/LinearInterpolator;-><init>()V
invoke-virtual {v10, v0}, Landroid/animation/ValueAnimator;->setInterpolator(Landroid/animation/TimeInterpolator;)V
sub-int v0, v9, v8
add-int/2addr v0, v4
const/16 v5, 0x3e8
.line 17
invoke-virtual {v1}, Lcom/opensource/svgaplayer/q;->c()I
move-result v1
div-int/2addr v5, v1
mul-int v0, v0, v5
int-to-double v0, v0
invoke-static {v0, v1}, Ljava/lang/Double;->isNaN(D)Z
div-double/2addr v0, v2
double-to-long v0, v0
invoke-virtual {v10, v0, v1}, Landroid/animation/ValueAnimator;->setDuration(J)Landroid/animation/ValueAnimator;
.line 18
iget v0, v7, Lcom/opensource/svgaplayer/SVGAImageView;->loops:I
if-gtz v0, :cond_a4
const v0, 0x1869f
goto :goto_a5
:cond_a4
sub-int/2addr v0, v4
:goto_a5
invoke-virtual {v10, v0}, Landroid/animation/ValueAnimator;->setRepeatCount(I)V
.line 19
new-instance v11, Lcom/opensource/svgaplayer/h;
move-object v0, v11
move-object v1, v10
move-object/from16 v2, p0
move-object/from16 v3, p1
move-object v4, v6
move/from16 v5, p2
invoke-direct/range {v0 .. v5}, Lcom/opensource/svgaplayer/h;-><init>(Landroid/animation/ValueAnimator;Lcom/opensource/svgaplayer/SVGAImageView;Lcom/opensource/svgaplayer/b/b;Lcom/opensource/svgaplayer/c;Z)V
invoke-virtual {v10, v11}, Landroid/animation/ValueAnimator;->addUpdateListener(Landroid/animation/ValueAnimator$AnimatorUpdateListener;)V
.line 20
new-instance v11, Lcom/opensource/svgaplayer/i;
move-object v0, v11
move v1, v8
move v2, v9
move-object/from16 v3, p0
move-object/from16 v4, p1
move-object v5, v6
move/from16 v6, p2
invoke-direct/range {v0 .. v6}, Lcom/opensource/svgaplayer/i;-><init>(IILcom/opensource/svgaplayer/SVGAImageView;Lcom/opensource/svgaplayer/b/b;Lcom/opensource/svgaplayer/c;Z)V
invoke-virtual {v10, v11}, Landroid/animation/ValueAnimator;->addListener(Landroid/animation/Animator$AnimatorListener;)V
if-eqz p2, :cond_d1
.line 21
invoke-virtual {v10}, Landroid/animation/ValueAnimator;->reverse()V
goto :goto_d4
.line 22
:cond_d1
invoke-virtual {v10}, Landroid/animation/ValueAnimator;->start()V
.line 23
:goto_d4
iput-object v10, v7, Lcom/opensource/svgaplayer/SVGAImageView;->animator:Landroid/animation/ValueAnimator;
return-void
.line 24
:cond_d7
invoke-virtual/range {p1 .. p1}, Lcom/opensource/svgaplayer/b/b;->a()I
throw v3
:cond_db
invoke-virtual/range {p1 .. p1}, Lcom/opensource/svgaplayer/b/b;->b()I
throw v3
.line 25
:cond_df
invoke-virtual/range {p1 .. p1}, Lcom/opensource/svgaplayer/b/b;->b()I
throw v3
:cond_e3
return-void
.end method
.method public final stepToFrame(IZ)V
.registers 6
.line 1
invoke-virtual {p0}, Lcom/opensource/svgaplayer/SVGAImageView;->pauseAnimation()V
.line 2
invoke-virtual {p0}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;
move-result-object v0
instance-of v1, v0, Lcom/opensource/svgaplayer/c;
if-nez v1, :cond_c
const/4 v0, 0x0
:cond_c
check-cast v0, Lcom/opensource/svgaplayer/c;
if-eqz v0, :cond_3d
.line 3
invoke-virtual {v0, p1}, Lcom/opensource/svgaplayer/c;->a(I)V
if-eqz p2, :cond_3d
.line 4
invoke-virtual {p0}, Lcom/opensource/svgaplayer/SVGAImageView;->startAnimation()V
.line 5
iget-object p2, p0, Lcom/opensource/svgaplayer/SVGAImageView;->animator:Landroid/animation/ValueAnimator;
if-eqz p2, :cond_3d
const/4 v1, 0x0
const/high16 v2, 0x3f800000 # 1.0f
int-to-float p1, p1
.line 6
invoke-virtual {v0}, Lcom/opensource/svgaplayer/c;->c()Lcom/opensource/svgaplayer/q;
move-result-object v0
invoke-virtual {v0}, Lcom/opensource/svgaplayer/q;->d()I
move-result v0
int-to-float v0, v0
div-float/2addr p1, v0
invoke-static {v2, p1}, Ljava/lang/Math;->min(FF)F
move-result p1
invoke-static {v1, p1}, Ljava/lang/Math;->max(FF)F
move-result p1
invoke-virtual {p2}, Landroid/animation/ValueAnimator;->getDuration()J
move-result-wide v0
long-to-float v0, v0
mul-float p1, p1, v0
float-to-long v0, p1
invoke-virtual {p2, v0, v1}, Landroid/animation/ValueAnimator;->setCurrentPlayTime(J)V
:cond_3d
return-void
.end method
.method public final stepToPercentage(DZ)V
.registers 7
.line 1
invoke-virtual {p0}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;
move-result-object v0
instance-of v1, v0, Lcom/opensource/svgaplayer/c;
if-nez v1, :cond_9
const/4 v0, 0x0
:cond_9
check-cast v0, Lcom/opensource/svgaplayer/c;
if-eqz v0, :cond_35
.line 2
invoke-virtual {v0}, Lcom/opensource/svgaplayer/c;->c()Lcom/opensource/svgaplayer/q;
move-result-object v1
invoke-virtual {v1}, Lcom/opensource/svgaplayer/q;->d()I
move-result v1
int-to-double v1, v1
invoke-static {v1, v2}, Ljava/lang/Double;->isNaN(D)Z
mul-double v1, v1, p1
double-to-int p1, v1
.line 3
invoke-virtual {v0}, Lcom/opensource/svgaplayer/c;->c()Lcom/opensource/svgaplayer/q;
move-result-object p2
invoke-virtual {p2}, Lcom/opensource/svgaplayer/q;->d()I
move-result p2
if-lt p1, p2, :cond_32
if-lez p1, :cond_32
.line 4
invoke-virtual {v0}, Lcom/opensource/svgaplayer/c;->c()Lcom/opensource/svgaplayer/q;
move-result-object p1
invoke-virtual {p1}, Lcom/opensource/svgaplayer/q;->d()I
move-result p1
add-int/lit8 p1, p1, -0x1
.line 5
:cond_32
invoke-virtual {p0, p1, p3}, Lcom/opensource/svgaplayer/SVGAImageView;->stepToFrame(IZ)V
:cond_35
return-void
.end method
.method public final stopAnimation()V
.registers 2
.line 1
iget-boolean v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->clearsAfterStop:Z
invoke-virtual {p0, v0}, Lcom/opensource/svgaplayer/SVGAImageView;->stopAnimation(Z)V
return-void
.end method
.method public final stopAnimation(Z)V
.registers 4
.line 2
iget-object v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->animator:Landroid/animation/ValueAnimator;
if-eqz v0, :cond_7
invoke-virtual {v0}, Landroid/animation/ValueAnimator;->cancel()V
.line 3
:cond_7
iget-object v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->animator:Landroid/animation/ValueAnimator;
if-eqz v0, :cond_e
invoke-virtual {v0}, Landroid/animation/ValueAnimator;->removeAllListeners()V
.line 4
:cond_e
iget-object v0, p0, Lcom/opensource/svgaplayer/SVGAImageView;->animator:Landroid/animation/ValueAnimator;
if-eqz v0, :cond_15
invoke-virtual {v0}, Landroid/animation/ValueAnimator;->removeAllUpdateListeners()V
.line 5
:cond_15
invoke-virtual {p0}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;
move-result-object v0
instance-of v1, v0, Lcom/opensource/svgaplayer/c;
if-nez v1, :cond_1e
const/4 v0, 0x0
:cond_1e
check-cast v0, Lcom/opensource/svgaplayer/c;
if-eqz v0, :cond_25
.line 6
invoke-virtual {v0, p1}, Lcom/opensource/svgaplayer/c;->a(Z)V
:cond_25
return-void
.end method