ImageViewBindingAdapters.smali

.class public Lcom/sandboxol/common/binding/adapter/ImageViewBindingAdapters;
.super Ljava/lang/Object;
.source "ImageViewBindingAdapters.java"


# direct methods
.method public constructor <init>()V
    .registers 1

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

    return-void
.end method

.method public static assetsImage(Landroid/widget/ImageView;Ljava/lang/String;)V
    .registers 3

    .line 1
    invoke-virtual {p0}, Landroid/widget/ImageView;->getContext()Landroid/content/Context;

    move-result-object v0

    if-nez v0, :cond_7

    return-void

    .line 2
    :cond_7
    invoke-virtual {p0}, Landroid/widget/ImageView;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/Context;->getAssets()Landroid/content/res/AssetManager;

    move-result-object v0

    .line 3
    :try_start_f
    invoke-virtual {v0, p1}, Landroid/content/res/AssetManager;->open(Ljava/lang/String;)Ljava/io/InputStream;

    move-result-object p1

    .line 4
    invoke-static {p1}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;)Landroid/graphics/Bitmap;

    move-result-object p1

    .line 5
    invoke-virtual {p0, p1}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V
    :try_end_1a
    .catch Ljava/lang/Exception; {:try_start_f .. :try_end_1a} :catch_1a

    :catch_1a
    return-void
.end method

.method public static imageAnim(Landroid/widget/ImageView;ZLjava/lang/String;)V
    .registers 10

    const-string v0, "round"

    .line 1
    invoke-virtual {p2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p2

    if-eqz p2, :cond_32

    invoke-virtual {p0}, Landroid/widget/ImageView;->getContext()Landroid/content/Context;

    move-result-object p2

    if-eqz p2, :cond_32

    .line 2
    new-instance p2, Landroid/view/animation/RotateAnimation;

    const/4 v1, 0x0

    const/high16 v2, 0x43b40000    # 360.0f

    const/4 v3, 0x1

    const/high16 v4, 0x3f000000    # 0.5f

    const/4 v5, 0x1

    const/high16 v6, 0x3f000000    # 0.5f

    move-object v0, p2

    invoke-direct/range {v0 .. v6}, Landroid/view/animation/RotateAnimation;-><init>(FFIFIF)V

    const/4 v0, -0x1

    .line 3
    invoke-virtual {p2, v0}, Landroid/view/animation/RotateAnimation;->setRepeatCount(I)V

    const-wide/16 v0, 0x3e8

    .line 4
    invoke-virtual {p2, v0, v1}, Landroid/view/animation/RotateAnimation;->setDuration(J)V

    .line 5
    invoke-virtual {p0, p2}, Landroid/widget/ImageView;->setAnimation(Landroid/view/animation/Animation;)V

    if-eqz p1, :cond_2f

    .line 6
    invoke-virtual {p2}, Landroid/view/animation/RotateAnimation;->start()V

    goto :goto_32

    .line 7
    :cond_2f
    invoke-virtual {p2}, Landroid/view/animation/RotateAnimation;->cancel()V

    :cond_32
    :goto_32
    return-void
.end method

.method public static isEnable(Landroid/widget/ImageView;Z)V
    .registers 2

    .line 1
    invoke-virtual {p0, p1}, Landroid/widget/ImageView;->setEnabled(Z)V

    return-void
.end method

.method public static isStartAnim(Landroid/widget/ImageView;Z)V
    .registers 2

    if-eqz p1, :cond_11

    .line 1
    invoke-virtual {p0}, Landroid/widget/ImageView;->getBackground()Landroid/graphics/drawable/Drawable;

    move-result-object p0

    check-cast p0, Landroid/graphics/drawable/AnimationDrawable;

    .line 2
    invoke-virtual {p0}, Landroid/graphics/drawable/AnimationDrawable;->isRunning()Z

    move-result p1

    if-nez p1, :cond_11

    .line 3
    invoke-virtual {p0}, Landroid/graphics/drawable/AnimationDrawable;->start()V

    :cond_11
    return-void
.end method

.method public static isStartAnimByXml(Landroid/widget/ImageView;I)V
    .registers 3

    .line 1
    invoke-virtual {p0}, Landroid/widget/ImageView;->getContext()Landroid/content/Context;

    move-result-object v0

    if-nez v0, :cond_7

    return-void

    :cond_7
    const/4 v0, 0x1

    if-ne p1, v0, :cond_e

    .line 2
    invoke-virtual {p0}, Landroid/widget/ImageView;->clearAnimation()V

    return-void

    :cond_e
    if-eqz p1, :cond_1b

    .line 3
    invoke-virtual {p0}, Landroid/widget/ImageView;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0, p1}, Landroid/view/animation/AnimationUtils;->loadAnimation(Landroid/content/Context;I)Landroid/view/animation/Animation;

    move-result-object p1

    .line 4
    invoke-virtual {p0, p1}, Landroid/widget/ImageView;->startAnimation(Landroid/view/animation/Animation;)V

    :cond_1b
    return-void
.end method

.method public static isStartRoundAnim(Landroid/widget/ImageView;ZI)V
    .registers 10

    if-eqz p1, :cond_2a

    .line 1
    new-instance p1, Landroid/view/animation/RotateAnimation;

    const/4 v1, 0x0

    const/high16 v2, 0x43b40000    # 360.0f

    const/4 v3, 0x1

    const/high16 v4, 0x3f000000    # 0.5f

    const/4 v5, 0x1

    const/high16 v6, 0x3f000000    # 0.5f

    move-object v0, p1

    invoke-direct/range {v0 .. v6}, Landroid/view/animation/RotateAnimation;-><init>(FFIFIF)V

    if-nez p2, :cond_16

    const-wide/16 v0, 0x1388

    goto :goto_17

    :cond_16
    int-to-long v0, p2

    .line 2
    :goto_17
    invoke-virtual {p1, v0, v1}, Landroid/view/animation/RotateAnimation;->setDuration(J)V

    const/4 p2, -0x1

    .line 3
    invoke-virtual {p1, p2}, Landroid/view/animation/RotateAnimation;->setRepeatCount(I)V

    .line 4
    new-instance p2, Landroid/view/animation/LinearInterpolator;

    invoke-direct {p2}, Landroid/view/animation/LinearInterpolator;-><init>()V

    invoke-virtual {p1, p2}, Landroid/view/animation/RotateAnimation;->setInterpolator(Landroid/view/animation/Interpolator;)V

    .line 5
    invoke-virtual {p0, p1}, Landroid/widget/ImageView;->startAnimation(Landroid/view/animation/Animation;)V

    goto :goto_2d

    .line 6
    :cond_2a
    invoke-virtual {p0}, Landroid/widget/ImageView;->clearAnimation()V

    :goto_2d
    return-void
.end method

.method private static isValidContextForGlide(Landroid/view/View;)Z
    .registers 4

    .line 1
    invoke-virtual {p0}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v0

    const/4 v1, 0x0

    if-nez v0, :cond_8

    return v1

    .line 2
    :cond_8
    invoke-virtual {p0}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v0

    instance-of v0, v0, Landroid/app/Activity;

    if-eqz v0, :cond_28

    .line 3
    invoke-static {p0}, Lcom/sandboxol/common/utils/CommonHelper;->getActivityByView(Landroid/view/View;)Landroid/app/Activity;

    move-result-object p0

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

    const/16 v2, 0x11

    if-lt v0, v2, :cond_21

    invoke-virtual {p0}, Landroid/app/Activity;->isDestroyed()Z

    move-result v0

    if-eqz v0, :cond_21

    return v1

    .line 5
    :cond_21
    invoke-virtual {p0}, Landroid/app/Activity;->isFinishing()Z

    move-result p0

    if-eqz p0, :cond_28

    return v1

    :cond_28
    const/4 p0, 0x1

    return p0
.end method

.method public static loadImage(Landroid/widget/ImageView;ILjava/lang/String;IIZZZZFZLcom/sandboxol/common/command/ReplyCommand;)V
    .registers 13
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/widget/ImageView;",
            "I",
            "Ljava/lang/String;",
            "IIZZZZFZ",
            "Lcom/sandboxol/common/command/ReplyCommand<",
            "Landroid/graphics/drawable/Drawable;",
            ">;)V"
        }
    .end annotation

    if-nez p4, :cond_5

    if-eqz p3, :cond_5

    move p4, p3

    .line 2
    :cond_5
    invoke-static {}, Lcom/bumptech/glide/e/n;->d()Z

    move-result v0

    if-eqz v0, :cond_8b

    invoke-static {p0}, Lcom/sandboxol/common/binding/adapter/ImageViewBindingAdapters;->isValidContextForGlide(Landroid/view/View;)Z

    move-result v0

    if-eqz v0, :cond_8b

    .line 3
    :try_start_11
    invoke-virtual {p0}, Landroid/widget/ImageView;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Lcom/bumptech/glide/b;->b(Landroid/content/Context;)Lcom/bumptech/glide/j;

    move-result-object v0

    if-lez p1, :cond_24

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

    move-result-object p1

    invoke-virtual {v0, p1}, Lcom/bumptech/glide/j;->a(Ljava/lang/Integer;)Lcom/bumptech/glide/h;

    move-result-object p1

    goto :goto_28

    .line 5
    :cond_24
    invoke-virtual {v0, p2}, Lcom/bumptech/glide/j;->a(Ljava/lang/String;)Lcom/bumptech/glide/h;

    move-result-object p1

    :goto_28
    if-eqz p3, :cond_33

    .line 6
    invoke-virtual {p1, p3}, Lcom/bumptech/glide/request/a;->d(I)Lcom/bumptech/glide/request/a;

    move-result-object p2

    check-cast p2, Lcom/bumptech/glide/h;

    .line 7
    invoke-virtual {p2, p3}, Lcom/bumptech/glide/request/a;->b(I)Lcom/bumptech/glide/request/a;

    .line 8
    :cond_33
    new-instance p2, Lcom/bumptech/glide/request/f;

    invoke-direct {p2}, Lcom/bumptech/glide/request/f;-><init>()V

    const/4 p3, 0x0

    cmpl-float p3, p9, p3

    if-lez p3, :cond_58

    .line 9
    new-instance p3, Lcom/sandboxol/common/utils/RoundedCornersTransform;

    invoke-virtual {p0}, Landroid/widget/ImageView;->getContext()Landroid/content/Context;

    move-result-object p10

    invoke-virtual {p0}, Landroid/widget/ImageView;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0, p9}, Lcom/sandboxol/common/utils/SizeUtil;->dp2px(Landroid/content/Context;F)F

    move-result p9

    invoke-direct {p3, p10, p9}, Lcom/sandboxol/common/utils/RoundedCornersTransform;-><init>(Landroid/content/Context;F)V

    .line 10
    invoke-virtual {p3, p5, p6, p7, p8}, Lcom/sandboxol/common/utils/RoundedCornersTransform;->setNeedCorner(ZZZZ)V

    .line 11
    invoke-virtual {p2, p3}, Lcom/bumptech/glide/request/a;->a(Lcom/bumptech/glide/load/n;)Lcom/bumptech/glide/request/a;

    move-result-object p2

    check-cast p2, Lcom/bumptech/glide/request/f;

    goto :goto_60

    :cond_58
    if-eqz p10, :cond_60

    .line 12
    invoke-virtual {p2}, Lcom/bumptech/glide/request/a;->d()Lcom/bumptech/glide/request/a;

    move-result-object p2

    check-cast p2, Lcom/bumptech/glide/request/f;

    .line 13
    :cond_60
    :goto_60
    sget-object p3, Lcom/bumptech/glide/load/engine/p;->e:Lcom/bumptech/glide/load/engine/p;

    invoke-virtual {p2, p3}, Lcom/bumptech/glide/request/a;->a(Lcom/bumptech/glide/load/engine/p;)Lcom/bumptech/glide/request/a;

    .line 14
    invoke-virtual {p1, p2}, Lcom/bumptech/glide/h;->a(Lcom/bumptech/glide/request/a;)Lcom/bumptech/glide/h;

    move-result-object p2

    new-instance p3, Lcom/sandboxol/common/binding/adapter/ImageViewBindingAdapters$1;

    invoke-direct {p3, p4, p0, p11}, Lcom/sandboxol/common/binding/adapter/ImageViewBindingAdapters$1;-><init>(ILandroid/widget/ImageView;Lcom/sandboxol/common/command/ReplyCommand;)V

    invoke-virtual {p2, p3}, Lcom/bumptech/glide/h;->b(Lcom/bumptech/glide/request/e;)Lcom/bumptech/glide/h;

    .line 15
    invoke-static {p0}, Lcom/sandboxol/common/utils/CommonHelper;->getActivityByView(Landroid/view/View;)Landroid/app/Activity;

    move-result-object p2

    if-eqz p2, :cond_7e

    .line 16
    invoke-virtual {p2}, Landroid/app/Activity;->isFinishing()Z

    move-result p2

    if-eqz p2, :cond_7e

    return-void

    .line 17
    :cond_7e
    invoke-virtual {p1, p0}, Lcom/bumptech/glide/h;->a(Landroid/widget/ImageView;)Lcom/bumptech/glide/request/target/ViewTarget;
    :try_end_81
    .catch Ljava/lang/IllegalArgumentException; {:try_start_11 .. :try_end_81} :catch_87
    .catch Landroid/content/res/Resources$NotFoundException; {:try_start_11 .. :try_end_81} :catch_82

    goto :goto_8b

    :catch_82
    move-exception p0

    .line 18
    invoke-virtual {p0}, Landroid/content/res/Resources$NotFoundException;->printStackTrace()V

    goto :goto_8b

    :catch_87
    move-exception p0

    .line 19
    invoke-virtual {p0}, Ljava/lang/IllegalArgumentException;->printStackTrace()V

    :cond_8b
    :goto_8b
    return-void
.end method

.method public static loadImage(Landroid/widget/ImageView;Ljava/lang/String;)V
    .registers 14

    const/4 v1, 0x0

    const/4 v3, 0x0

    const/4 v4, 0x0

    const/4 v5, 0x0

    const/4 v6, 0x0

    const/4 v7, 0x0

    const/4 v8, 0x0

    const/4 v9, 0x0

    const/4 v10, 0x0

    const/4 v11, 0x0

    move-object v0, p0

    move-object v2, p1

    .line 1
    invoke-static/range {v0 .. v11}, Lcom/sandboxol/common/binding/adapter/ImageViewBindingAdapters;->loadImage(Landroid/widget/ImageView;ILjava/lang/String;IIZZZZFZLcom/sandboxol/common/command/ReplyCommand;)V

    return-void
.end method

.method public static setDrawable(Landroid/widget/ImageView;Landroid/graphics/drawable/Drawable;)V
    .registers 3

    if-eqz p1, :cond_a

    const/4 v0, 0x0

    .line 1
    invoke-virtual {p0, v0}, Landroid/widget/ImageView;->setVisibility(I)V

    .line 2
    invoke-virtual {p0, p1}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    goto :goto_f

    :cond_a
    const/16 p1, 0x8

    .line 3
    invoke-virtual {p0, p1}, Landroid/widget/ImageView;->setVisibility(I)V

    :goto_f
    return-void
.end method

.method public static setGif(Landroid/widget/ImageView;ILjava/lang/String;II)V
    .registers 7

    .line 1
    invoke-virtual {p0}, Landroid/widget/ImageView;->getContext()Landroid/content/Context;

    move-result-object v0

    if-eqz v0, :cond_69

    if-eqz p1, :cond_32

    .line 2
    new-instance v0, Lcom/bumptech/glide/request/f;

    invoke-direct {v0}, Lcom/bumptech/glide/request/f;-><init>()V

    .line 3
    sget-object v1, Lcom/bumptech/glide/load/engine/p;->d:Lcom/bumptech/glide/load/engine/p;

    invoke-virtual {v0, v1}, Lcom/bumptech/glide/request/a;->a(Lcom/bumptech/glide/load/engine/p;)Lcom/bumptech/glide/request/a;

    .line 4
    :try_start_12
    invoke-static {}, Lcom/sandboxol/common/base/app/BaseApplication;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-static {v1}, Lcom/bumptech/glide/b;->b(Landroid/content/Context;)Lcom/bumptech/glide/j;

    move-result-object v1

    invoke-virtual {v1}, Lcom/bumptech/glide/j;->c()Lcom/bumptech/glide/h;

    move-result-object v1

    invoke-virtual {v1, v0}, Lcom/bumptech/glide/h;->a(Lcom/bumptech/glide/request/a;)Lcom/bumptech/glide/h;

    move-result-object v0

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

    move-result-object p1

    invoke-virtual {v0, p1}, Lcom/bumptech/glide/h;->a(Ljava/lang/Integer;)Lcom/bumptech/glide/h;

    move-result-object p1

    invoke-virtual {p1, p0}, Lcom/bumptech/glide/h;->a(Landroid/widget/ImageView;)Lcom/bumptech/glide/request/target/ViewTarget;
    :try_end_2d
    .catch Ljava/lang/IllegalArgumentException; {:try_start_12 .. :try_end_2d} :catch_2e

    goto :goto_32

    :catch_2e
    move-exception p1

    .line 5
    invoke-virtual {p1}, Ljava/lang/IllegalArgumentException;->printStackTrace()V

    .line 6
    :cond_32
    :goto_32
    invoke-static {p2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result p1

    if-nez p1, :cond_69

    .line 7
    new-instance p1, Lcom/bumptech/glide/request/f;

    invoke-direct {p1}, Lcom/bumptech/glide/request/f;-><init>()V

    .line 8
    sget-object v0, Lcom/bumptech/glide/load/engine/p;->d:Lcom/bumptech/glide/load/engine/p;

    invoke-virtual {p1, v0}, Lcom/bumptech/glide/request/a;->a(Lcom/bumptech/glide/load/engine/p;)Lcom/bumptech/glide/request/a;

    move-result-object v0

    check-cast v0, Lcom/bumptech/glide/request/f;

    .line 9
    invoke-virtual {v0, p4}, Lcom/bumptech/glide/request/a;->a(I)Lcom/bumptech/glide/request/a;

    move-result-object p4

    check-cast p4, Lcom/bumptech/glide/request/f;

    .line 10
    invoke-virtual {p4, p3}, Lcom/bumptech/glide/request/a;->d(I)Lcom/bumptech/glide/request/a;

    .line 11
    :try_start_4e
    invoke-static {}, Lcom/sandboxol/common/base/app/BaseApplication;->getContext()Landroid/content/Context;

    move-result-object p3

    invoke-static {p3}, Lcom/bumptech/glide/b;->b(Landroid/content/Context;)Lcom/bumptech/glide/j;

    move-result-object p3

    invoke-virtual {p3}, Lcom/bumptech/glide/j;->c()Lcom/bumptech/glide/h;

    move-result-object p3

    invoke-virtual {p3, p2}, Lcom/bumptech/glide/h;->a(Ljava/lang/String;)Lcom/bumptech/glide/h;

    invoke-virtual {p3, p1}, Lcom/bumptech/glide/h;->a(Lcom/bumptech/glide/request/a;)Lcom/bumptech/glide/h;

    move-result-object p1

    invoke-virtual {p1, p0}, Lcom/bumptech/glide/h;->a(Landroid/widget/ImageView;)Lcom/bumptech/glide/request/target/ViewTarget;
    :try_end_64
    .catch Ljava/lang/IllegalArgumentException; {:try_start_4e .. :try_end_64} :catch_65

    goto :goto_69

    :catch_65
    move-exception p0

    .line 12
    invoke-virtual {p0}, Ljava/lang/IllegalArgumentException;->printStackTrace()V

    :cond_69
    :goto_69
    return-void
.end method