apkfuckery/com.discord/smali/androidx/transition/ImageViewUtils.smali

180 lines
4.4 KiB
Smali
Raw Normal View History

2019-12-06 03:29:40 +00:00
.class public Landroidx/transition/ImageViewUtils;
2019-07-24 11:27:29 +00:00
.super Ljava/lang/Object;
.source "ImageViewUtils.java"
# static fields
2020-01-07 02:40:43 +00:00
.field public static sDrawMatrixField:Ljava/lang/reflect/Field; = null
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
.field public static sDrawMatrixFieldFetched:Z = false
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
.field public static sTryHiddenAnimateTransform:Z = true
2019-07-24 11:27:29 +00:00
# direct methods
2020-01-07 02:40:43 +00:00
.method public static constructor <clinit>()V
.locals 0
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public constructor <init>()V
2019-07-24 11:27:29 +00:00
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public static animateTransform(Landroid/widget/ImageView;Landroid/graphics/Matrix;)V
2019-07-24 11:27:29 +00:00
.locals 3
2020-01-07 02:40:43 +00:00
.param p0 # Landroid/widget/ImageView;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p1 # Landroid/graphics/Matrix;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
2019-07-24 11:27:29 +00:00
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
2020-01-07 02:40:43 +00:00
const/16 v1, 0x1d
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
if-lt v0, v1, :cond_0
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
invoke-virtual {p0, p1}, Landroid/widget/ImageView;->animateTransform(Landroid/graphics/Matrix;)V
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
goto :goto_0
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
:cond_0
if-nez p1, :cond_1
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
invoke-virtual {p0}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
move-result-object p1
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
if-eqz p1, :cond_2
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
invoke-virtual {p0}, Landroid/widget/ImageView;->getWidth()I
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
move-result v0
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
invoke-virtual {p0}, Landroid/widget/ImageView;->getPaddingLeft()I
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
move-result v1
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
sub-int/2addr v0, v1
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
invoke-virtual {p0}, Landroid/widget/ImageView;->getPaddingRight()I
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
move-result v1
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
sub-int/2addr v0, v1
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
invoke-virtual {p0}, Landroid/widget/ImageView;->getHeight()I
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
move-result v1
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
invoke-virtual {p0}, Landroid/widget/ImageView;->getPaddingTop()I
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
move-result v2
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
sub-int/2addr v1, v2
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
invoke-virtual {p0}, Landroid/widget/ImageView;->getPaddingBottom()I
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
move-result v2
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
sub-int/2addr v1, v2
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
const/4 v2, 0x0
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
invoke-virtual {p1, v2, v2, v0, v1}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
invoke-virtual {p0}, Landroid/widget/ImageView;->invalidate()V
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
goto :goto_0
:cond_1
invoke-static {p0, p1}, Landroidx/transition/ImageViewUtils;->hiddenAnimateTransform(Landroid/widget/ImageView;Landroid/graphics/Matrix;)V
:cond_2
:goto_0
return-void
.end method
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
.method public static fetchDrawMatrixField()V
.locals 3
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
sget-boolean v0, Landroidx/transition/ImageViewUtils;->sDrawMatrixFieldFetched:Z
2019-12-06 03:29:40 +00:00
2020-01-07 02:40:43 +00:00
if-nez v0, :cond_0
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
const/4 v0, 0x1
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
:try_start_0
const-class v1, Landroid/widget/ImageView;
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
const-string v2, "mDrawMatrix"
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
invoke-virtual {v1, v2}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
move-result-object v1
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
sput-object v1, Landroidx/transition/ImageViewUtils;->sDrawMatrixField:Ljava/lang/reflect/Field;
sget-object v1, Landroidx/transition/ImageViewUtils;->sDrawMatrixField:Ljava/lang/reflect/Field;
invoke-virtual {v1, v0}, Ljava/lang/reflect/Field;->setAccessible(Z)V
:try_end_0
.catch Ljava/lang/NoSuchFieldException; {:try_start_0 .. :try_end_0} :catch_0
:catch_0
sput-boolean v0, Landroidx/transition/ImageViewUtils;->sDrawMatrixFieldFetched:Z
2019-07-24 11:27:29 +00:00
:cond_0
return-void
.end method
2020-01-07 02:40:43 +00:00
.method public static hiddenAnimateTransform(Landroid/widget/ImageView;Landroid/graphics/Matrix;)V
.locals 1
.param p0 # Landroid/widget/ImageView;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p1 # Landroid/graphics/Matrix;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
.annotation build Landroid/annotation/SuppressLint;
value = {
"NewApi"
}
.end annotation
.annotation build Landroidx/annotation/RequiresApi;
value = 0x15
.end annotation
sget-boolean v0, Landroidx/transition/ImageViewUtils;->sTryHiddenAnimateTransform:Z
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
if-eqz v0, :cond_0
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
:try_start_0
invoke-virtual {p0, p1}, Landroid/widget/ImageView;->animateTransform(Landroid/graphics/Matrix;)V
:try_end_0
.catch Ljava/lang/NoSuchMethodError; {:try_start_0 .. :try_end_0} :catch_0
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
goto :goto_0
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
:catch_0
const/4 p0, 0x0
2019-07-24 11:27:29 +00:00
2020-01-07 02:40:43 +00:00
sput-boolean p0, Landroidx/transition/ImageViewUtils;->sTryHiddenAnimateTransform:Z
:cond_0
:goto_0
2019-07-24 11:27:29 +00:00
return-void
.end method