Rabbit-R1/original r1/smali/smali_classes2/androidx/transition/ChangeImageTransform.smali

636 lines
15 KiB
Smali
Raw Normal View History

2024-05-21 16:08:36 -05:00
.class public Landroidx/transition/ChangeImageTransform;
.super Landroidx/transition/Transition;
.source "ChangeImageTransform.java"
# static fields
.field private static final ANIMATED_TRANSFORM_PROPERTY:Landroid/util/Property;
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroid/util/Property<",
"Landroid/widget/ImageView;",
"Landroid/graphics/Matrix;",
">;"
}
.end annotation
.end field
.field private static final NULL_MATRIX_EVALUATOR:Landroid/animation/TypeEvaluator;
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroid/animation/TypeEvaluator<",
"Landroid/graphics/Matrix;",
">;"
}
.end annotation
.end field
.field private static final PROPNAME_BOUNDS:Ljava/lang/String; = "android:changeImageTransform:bounds"
.field private static final PROPNAME_MATRIX:Ljava/lang/String; = "android:changeImageTransform:matrix"
.field private static final sTransitionProperties:[Ljava/lang/String;
# direct methods
.method static constructor <clinit>()V
.locals 3
const-string v0, "android:changeImageTransform:matrix"
const-string v1, "android:changeImageTransform:bounds"
.line 50
filled-new-array {v0, v1}, [Ljava/lang/String;
move-result-object v0
sput-object v0, Landroidx/transition/ChangeImageTransform;->sTransitionProperties:[Ljava/lang/String;
.line 55
new-instance v0, Landroidx/transition/ChangeImageTransform$1;
invoke-direct {v0}, Landroidx/transition/ChangeImageTransform$1;-><init>()V
sput-object v0, Landroidx/transition/ChangeImageTransform;->NULL_MATRIX_EVALUATOR:Landroid/animation/TypeEvaluator;
.line 62
new-instance v0, Landroidx/transition/ChangeImageTransform$2;
const-class v1, Landroid/graphics/Matrix;
const-string v2, "animatedTransform"
invoke-direct {v0, v1, v2}, Landroidx/transition/ChangeImageTransform$2;-><init>(Ljava/lang/Class;Ljava/lang/String;)V
sput-object v0, Landroidx/transition/ChangeImageTransform;->ANIMATED_TRANSFORM_PROPERTY:Landroid/util/Property;
return-void
.end method
.method public constructor <init>()V
.locals 0
.line 75
invoke-direct {p0}, Landroidx/transition/Transition;-><init>()V
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.locals 0
.line 79
invoke-direct {p0, p1, p2}, Landroidx/transition/Transition;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
return-void
.end method
.method private captureValues(Landroidx/transition/TransitionValues;)V
.locals 5
.line 83
iget-object p0, p1, Landroidx/transition/TransitionValues;->view:Landroid/view/View;
.line 84
instance-of v0, p0, Landroid/widget/ImageView;
if-eqz v0, :cond_2
invoke-virtual {p0}, Landroid/view/View;->getVisibility()I
move-result v0
if-eqz v0, :cond_0
goto :goto_0
.line 87
:cond_0
move-object v0, p0
check-cast v0, Landroid/widget/ImageView;
.line 88
invoke-virtual {v0}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;
move-result-object v1
if-nez v1, :cond_1
return-void
.line 92
:cond_1
iget-object p1, p1, Landroidx/transition/TransitionValues;->values:Ljava/util/Map;
.line 94
invoke-virtual {p0}, Landroid/view/View;->getLeft()I
move-result v1
.line 95
invoke-virtual {p0}, Landroid/view/View;->getTop()I
move-result v2
.line 96
invoke-virtual {p0}, Landroid/view/View;->getRight()I
move-result v3
.line 97
invoke-virtual {p0}, Landroid/view/View;->getBottom()I
move-result p0
.line 99
new-instance v4, Landroid/graphics/Rect;
invoke-direct {v4, v1, v2, v3, p0}, Landroid/graphics/Rect;-><init>(IIII)V
const-string p0, "android:changeImageTransform:bounds"
.line 100
invoke-interface {p1, p0, v4}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
const-string p0, "android:changeImageTransform:matrix"
.line 101
invoke-static {v0}, Landroidx/transition/ChangeImageTransform;->copyImageMatrix(Landroid/widget/ImageView;)Landroid/graphics/Matrix;
move-result-object v0
invoke-interface {p1, p0, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
:cond_2
:goto_0
return-void
.end method
.method private static centerCropMatrix(Landroid/widget/ImageView;)Landroid/graphics/Matrix;
.locals 5
.line 222
invoke-virtual {p0}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;
move-result-object v0
.line 223
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I
move-result v1
.line 224
invoke-virtual {p0}, Landroid/widget/ImageView;->getWidth()I
move-result v2
int-to-float v2, v2
int-to-float v1, v1
div-float v3, v2, v1
.line 227
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I
move-result v0
.line 228
invoke-virtual {p0}, Landroid/widget/ImageView;->getHeight()I
move-result p0
int-to-float p0, p0
int-to-float v0, v0
div-float v4, p0, v0
.line 231
invoke-static {v3, v4}, Ljava/lang/Math;->max(FF)F
move-result v3
mul-float/2addr v1, v3
mul-float/2addr v0, v3
sub-float/2addr v2, v1
const/high16 v1, 0x40000000 # 2.0f
div-float/2addr v2, v1
.line 235
invoke-static {v2}, Ljava/lang/Math;->round(F)I
move-result v2
sub-float/2addr p0, v0
div-float/2addr p0, v1
.line 236
invoke-static {p0}, Ljava/lang/Math;->round(F)I
move-result p0
.line 238
new-instance v0, Landroid/graphics/Matrix;
invoke-direct {v0}, Landroid/graphics/Matrix;-><init>()V
.line 239
invoke-virtual {v0, v3, v3}, Landroid/graphics/Matrix;->postScale(FF)Z
int-to-float v1, v2
int-to-float p0, p0
.line 240
invoke-virtual {v0, v1, p0}, Landroid/graphics/Matrix;->postTranslate(FF)Z
return-object v0
.end method
.method private static copyImageMatrix(Landroid/widget/ImageView;)Landroid/graphics/Matrix;
.locals 2
.line 190
invoke-virtual {p0}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;
move-result-object v0
.line 191
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I
move-result v1
if-lez v1, :cond_2
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I
move-result v0
if-lez v0, :cond_2
.line 192
sget-object v0, Landroidx/transition/ChangeImageTransform$3;->$SwitchMap$android$widget$ImageView$ScaleType:[I
invoke-virtual {p0}, Landroid/widget/ImageView;->getScaleType()Landroid/widget/ImageView$ScaleType;
move-result-object v1
invoke-virtual {v1}, Landroid/widget/ImageView$ScaleType;->ordinal()I
move-result v1
aget v0, v0, v1
const/4 v1, 0x1
if-eq v0, v1, :cond_1
const/4 v1, 0x2
if-eq v0, v1, :cond_0
.line 198
new-instance v0, Landroid/graphics/Matrix;
invoke-virtual {p0}, Landroid/widget/ImageView;->getImageMatrix()Landroid/graphics/Matrix;
move-result-object p0
invoke-direct {v0, p0}, Landroid/graphics/Matrix;-><init>(Landroid/graphics/Matrix;)V
return-object v0
.line 196
:cond_0
invoke-static {p0}, Landroidx/transition/ChangeImageTransform;->centerCropMatrix(Landroid/widget/ImageView;)Landroid/graphics/Matrix;
move-result-object p0
return-object p0
.line 194
:cond_1
invoke-static {p0}, Landroidx/transition/ChangeImageTransform;->fitXYMatrix(Landroid/widget/ImageView;)Landroid/graphics/Matrix;
move-result-object p0
return-object p0
.line 201
:cond_2
new-instance v0, Landroid/graphics/Matrix;
invoke-virtual {p0}, Landroid/widget/ImageView;->getImageMatrix()Landroid/graphics/Matrix;
move-result-object p0
invoke-direct {v0, p0}, Landroid/graphics/Matrix;-><init>(Landroid/graphics/Matrix;)V
return-object v0
.end method
.method private createMatrixAnimator(Landroid/widget/ImageView;Landroid/graphics/Matrix;Landroid/graphics/Matrix;)Landroid/animation/ObjectAnimator;
.locals 3
sget-object p0, Landroidx/transition/ChangeImageTransform;->ANIMATED_TRANSFORM_PROPERTY:Landroid/util/Property;
.line 184
new-instance v0, Landroidx/transition/TransitionUtils$MatrixEvaluator;
invoke-direct {v0}, Landroidx/transition/TransitionUtils$MatrixEvaluator;-><init>()V
const/4 v1, 0x2
new-array v1, v1, [Landroid/graphics/Matrix;
const/4 v2, 0x0
aput-object p2, v1, v2
const/4 p2, 0x1
aput-object p3, v1, p2
invoke-static {p1, p0, v0, v1}, Landroid/animation/ObjectAnimator;->ofObject(Ljava/lang/Object;Landroid/util/Property;Landroid/animation/TypeEvaluator;[Ljava/lang/Object;)Landroid/animation/ObjectAnimator;
move-result-object p0
return-object p0
.end method
.method private createNullAnimator(Landroid/widget/ImageView;)Landroid/animation/ObjectAnimator;
.locals 4
sget-object p0, Landroidx/transition/ChangeImageTransform;->ANIMATED_TRANSFORM_PROPERTY:Landroid/util/Property;
sget-object v0, Landroidx/transition/ChangeImageTransform;->NULL_MATRIX_EVALUATOR:Landroid/animation/TypeEvaluator;
const/4 v1, 0x2
new-array v1, v1, [Landroid/graphics/Matrix;
const/4 v2, 0x0
.line 178
sget-object v3, Landroidx/transition/MatrixUtils;->IDENTITY_MATRIX:Landroid/graphics/Matrix;
aput-object v3, v1, v2
const/4 v2, 0x1
sget-object v3, Landroidx/transition/MatrixUtils;->IDENTITY_MATRIX:Landroid/graphics/Matrix;
aput-object v3, v1, v2
invoke-static {p1, p0, v0, v1}, Landroid/animation/ObjectAnimator;->ofObject(Ljava/lang/Object;Landroid/util/Property;Landroid/animation/TypeEvaluator;[Ljava/lang/Object;)Landroid/animation/ObjectAnimator;
move-result-object p0
return-object p0
.end method
.method private static fitXYMatrix(Landroid/widget/ImageView;)Landroid/graphics/Matrix;
.locals 4
.line 209
invoke-virtual {p0}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;
move-result-object v0
.line 210
new-instance v1, Landroid/graphics/Matrix;
invoke-direct {v1}, Landroid/graphics/Matrix;-><init>()V
.line 212
invoke-virtual {p0}, Landroid/widget/ImageView;->getWidth()I
move-result v2
int-to-float v2, v2
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I
move-result v3
int-to-float v3, v3
div-float/2addr v2, v3
.line 213
invoke-virtual {p0}, Landroid/widget/ImageView;->getHeight()I
move-result p0
int-to-float p0, p0
invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I
move-result v0
int-to-float v0, v0
div-float/2addr p0, v0
.line 211
invoke-virtual {v1, v2, p0}, Landroid/graphics/Matrix;->postScale(FF)Z
return-object v1
.end method
# virtual methods
.method public captureEndValues(Landroidx/transition/TransitionValues;)V
.locals 0
.line 111
invoke-direct {p0, p1}, Landroidx/transition/ChangeImageTransform;->captureValues(Landroidx/transition/TransitionValues;)V
return-void
.end method
.method public captureStartValues(Landroidx/transition/TransitionValues;)V
.locals 0
.line 106
invoke-direct {p0, p1}, Landroidx/transition/ChangeImageTransform;->captureValues(Landroidx/transition/TransitionValues;)V
return-void
.end method
.method public createAnimator(Landroid/view/ViewGroup;Landroidx/transition/TransitionValues;Landroidx/transition/TransitionValues;)Landroid/animation/Animator;
.locals 4
const/4 p1, 0x0
if-eqz p2, :cond_a
if-nez p3, :cond_0
goto/16 :goto_3
.line 138
:cond_0
iget-object v0, p2, Landroidx/transition/TransitionValues;->values:Ljava/util/Map;
const-string v1, "android:changeImageTransform:bounds"
invoke-interface {v0, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/graphics/Rect;
.line 139
iget-object v2, p3, Landroidx/transition/TransitionValues;->values:Ljava/util/Map;
invoke-interface {v2, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroid/graphics/Rect;
if-eqz v0, :cond_a
if-nez v1, :cond_1
goto :goto_3
.line 144
:cond_1
iget-object p2, p2, Landroidx/transition/TransitionValues;->values:Ljava/util/Map;
const-string v2, "android:changeImageTransform:matrix"
invoke-interface {p2, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p2
check-cast p2, Landroid/graphics/Matrix;
.line 145
iget-object v3, p3, Landroidx/transition/TransitionValues;->values:Ljava/util/Map;
invoke-interface {v3, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroid/graphics/Matrix;
if-nez p2, :cond_2
if-eqz v2, :cond_3
:cond_2
if-eqz p2, :cond_4
.line 148
invoke-virtual {p2, v2}, Landroid/graphics/Matrix;->equals(Ljava/lang/Object;)Z
move-result v3
if-eqz v3, :cond_4
:cond_3
const/4 v3, 0x1
goto :goto_0
:cond_4
const/4 v3, 0x0
.line 150
:goto_0
invoke-virtual {v0, v1}, Landroid/graphics/Rect;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_5
if-eqz v3, :cond_5
return-object p1
.line 154
:cond_5
iget-object p1, p3, Landroidx/transition/TransitionValues;->view:Landroid/view/View;
check-cast p1, Landroid/widget/ImageView;
.line 155
invoke-virtual {p1}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;
move-result-object p3
.line 156
invoke-virtual {p3}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I
move-result v0
.line 157
invoke-virtual {p3}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I
move-result p3
if-lez v0, :cond_9
if-gtz p3, :cond_6
goto :goto_1
:cond_6
if-nez p2, :cond_7
.line 164
sget-object p2, Landroidx/transition/MatrixUtils;->IDENTITY_MATRIX:Landroid/graphics/Matrix;
:cond_7
if-nez v2, :cond_8
.line 167
sget-object v2, Landroidx/transition/MatrixUtils;->IDENTITY_MATRIX:Landroid/graphics/Matrix;
:cond_8
sget-object p3, Landroidx/transition/ChangeImageTransform;->ANIMATED_TRANSFORM_PROPERTY:Landroid/util/Property;
.line 169
invoke-virtual {p3, p1, p2}, Landroid/util/Property;->set(Ljava/lang/Object;Ljava/lang/Object;)V
.line 170
invoke-direct {p0, p1, p2, v2}, Landroidx/transition/ChangeImageTransform;->createMatrixAnimator(Landroid/widget/ImageView;Landroid/graphics/Matrix;Landroid/graphics/Matrix;)Landroid/animation/ObjectAnimator;
move-result-object p0
goto :goto_2
.line 161
:cond_9
:goto_1
invoke-direct {p0, p1}, Landroidx/transition/ChangeImageTransform;->createNullAnimator(Landroid/widget/ImageView;)Landroid/animation/ObjectAnimator;
move-result-object p0
:goto_2
return-object p0
:cond_a
:goto_3
return-object p1
.end method
.method public getTransitionProperties()[Ljava/lang/String;
.locals 0
sget-object p0, Landroidx/transition/ChangeImageTransform;->sTransitionProperties:[Ljava/lang/String;
return-object p0
.end method