171 lines
4.2 KiB
Smali
171 lines
4.2 KiB
Smali
.class public Landroidx/transition/ImageViewUtils;
|
|
.super Ljava/lang/Object;
|
|
.source "ImageViewUtils.java"
|
|
|
|
|
|
# static fields
|
|
.field private static sDrawMatrixField:Ljava/lang/reflect/Field; = null
|
|
|
|
.field private static sDrawMatrixFieldFetched:Z = false
|
|
|
|
.field private static sTryHiddenAnimateTransform:Z = true
|
|
|
|
|
|
# direct methods
|
|
.method private constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static animateTransform(Landroid/widget/ImageView;Landroid/graphics/Matrix;)V
|
|
.locals 3
|
|
.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
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v1, 0x1d
|
|
|
|
if-lt v0, v1, :cond_0
|
|
|
|
invoke-virtual {p0, p1}, Landroid/widget/ImageView;->animateTransform(Landroid/graphics/Matrix;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
if-nez p1, :cond_1
|
|
|
|
invoke-virtual {p0}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
invoke-virtual {p0}, Landroid/widget/ImageView;->getWidth()I
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {p0}, Landroid/widget/ImageView;->getPaddingLeft()I
|
|
|
|
move-result v1
|
|
|
|
sub-int/2addr v0, v1
|
|
|
|
invoke-virtual {p0}, Landroid/widget/ImageView;->getPaddingRight()I
|
|
|
|
move-result v1
|
|
|
|
sub-int/2addr v0, v1
|
|
|
|
invoke-virtual {p0}, Landroid/widget/ImageView;->getHeight()I
|
|
|
|
move-result v1
|
|
|
|
invoke-virtual {p0}, Landroid/widget/ImageView;->getPaddingTop()I
|
|
|
|
move-result v2
|
|
|
|
sub-int/2addr v1, v2
|
|
|
|
invoke-virtual {p0}, Landroid/widget/ImageView;->getPaddingBottom()I
|
|
|
|
move-result v2
|
|
|
|
sub-int/2addr v1, v2
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-virtual {p1, v2, v2, v0, v1}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V
|
|
|
|
invoke-virtual {p0}, Landroid/widget/ImageView;->invalidate()V
|
|
|
|
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
|
|
|
|
.method private static fetchDrawMatrixField()V
|
|
.locals 3
|
|
|
|
sget-boolean v0, Landroidx/transition/ImageViewUtils;->sDrawMatrixFieldFetched:Z
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
:try_start_0
|
|
const-class v1, Landroid/widget/ImageView;
|
|
|
|
const-string v2, "mDrawMatrix"
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/Class;->getDeclaredField(Ljava/lang/String;)Ljava/lang/reflect/Field;
|
|
|
|
move-result-object v1
|
|
|
|
sput-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
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private 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
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
: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
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
const/4 p0, 0x0
|
|
|
|
sput-boolean p0, Landroidx/transition/ImageViewUtils;->sTryHiddenAnimateTransform:Z
|
|
|
|
:cond_0
|
|
:goto_0
|
|
return-void
|
|
.end method
|