Rabbit-R1/original r1/smali/smali_classes2/androidx/transition/TransitionUtils.smali
2024-05-21 17:08:36 -04:00

429 lines
9.5 KiB
Smali

.class Landroidx/transition/TransitionUtils;
.super Ljava/lang/Object;
.source "TransitionUtils.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/transition/TransitionUtils$MatrixEvaluator;
}
.end annotation
# static fields
.field private static final HAS_IS_ATTACHED_TO_WINDOW:Z
.field private static final HAS_OVERLAY:Z
.field private static final HAS_PICTURE_BITMAP:Z
.field private static final MAX_IMAGE_SIZE:I = 0x100000
# direct methods
.method static constructor <clinit>()V
.locals 1
const/4 v0, 0x1
sput-boolean v0, Landroidx/transition/TransitionUtils;->HAS_IS_ATTACHED_TO_WINDOW:Z
sput-boolean v0, Landroidx/transition/TransitionUtils;->HAS_OVERLAY:Z
sput-boolean v0, Landroidx/transition/TransitionUtils;->HAS_PICTURE_BITMAP:Z
return-void
.end method
.method private constructor <init>()V
.locals 0
.line 177
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method static copyViewImage(Landroid/view/ViewGroup;Landroid/view/View;Landroid/view/View;)Landroid/view/View;
.locals 7
.line 51
new-instance v0, Landroid/graphics/Matrix;
invoke-direct {v0}, Landroid/graphics/Matrix;-><init>()V
.line 52
invoke-virtual {p2}, Landroid/view/View;->getScrollX()I
move-result v1
neg-int v1, v1
int-to-float v1, v1
invoke-virtual {p2}, Landroid/view/View;->getScrollY()I
move-result p2
neg-int p2, p2
int-to-float p2, p2
invoke-virtual {v0, v1, p2}, Landroid/graphics/Matrix;->setTranslate(FF)V
.line 53
invoke-static {p1, v0}, Landroidx/transition/ViewUtils;->transformMatrixToGlobal(Landroid/view/View;Landroid/graphics/Matrix;)V
.line 54
invoke-static {p0, v0}, Landroidx/transition/ViewUtils;->transformMatrixToLocal(Landroid/view/View;Landroid/graphics/Matrix;)V
.line 55
new-instance p2, Landroid/graphics/RectF;
invoke-virtual {p1}, Landroid/view/View;->getWidth()I
move-result v1
int-to-float v1, v1
invoke-virtual {p1}, Landroid/view/View;->getHeight()I
move-result v2
int-to-float v2, v2
const/4 v3, 0x0
invoke-direct {p2, v3, v3, v1, v2}, Landroid/graphics/RectF;-><init>(FFFF)V
.line 56
invoke-virtual {v0, p2}, Landroid/graphics/Matrix;->mapRect(Landroid/graphics/RectF;)Z
.line 57
iget v1, p2, Landroid/graphics/RectF;->left:F
invoke-static {v1}, Ljava/lang/Math;->round(F)I
move-result v1
.line 58
iget v2, p2, Landroid/graphics/RectF;->top:F
invoke-static {v2}, Ljava/lang/Math;->round(F)I
move-result v2
.line 59
iget v3, p2, Landroid/graphics/RectF;->right:F
invoke-static {v3}, Ljava/lang/Math;->round(F)I
move-result v3
.line 60
iget v4, p2, Landroid/graphics/RectF;->bottom:F
invoke-static {v4}, Ljava/lang/Math;->round(F)I
move-result v4
.line 62
new-instance v5, Landroid/widget/ImageView;
invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v6
invoke-direct {v5, v6}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V
.line 63
sget-object v6, Landroid/widget/ImageView$ScaleType;->CENTER_CROP:Landroid/widget/ImageView$ScaleType;
invoke-virtual {v5, v6}, Landroid/widget/ImageView;->setScaleType(Landroid/widget/ImageView$ScaleType;)V
.line 64
invoke-static {p1, v0, p2, p0}, Landroidx/transition/TransitionUtils;->createViewBitmap(Landroid/view/View;Landroid/graphics/Matrix;Landroid/graphics/RectF;Landroid/view/ViewGroup;)Landroid/graphics/Bitmap;
move-result-object p0
if-eqz p0, :cond_0
.line 66
invoke-virtual {v5, p0}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V
:cond_0
sub-int p0, v3, v1
const/high16 p1, 0x40000000 # 2.0f
.line 68
invoke-static {p0, p1}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I
move-result p0
sub-int p2, v4, v2
.line 69
invoke-static {p2, p1}, Landroid/view/View$MeasureSpec;->makeMeasureSpec(II)I
move-result p1
.line 70
invoke-virtual {v5, p0, p1}, Landroid/widget/ImageView;->measure(II)V
.line 71
invoke-virtual {v5, v1, v2, v3, v4}, Landroid/widget/ImageView;->layout(IIII)V
return-object v5
.end method
.method private static createViewBitmap(Landroid/view/View;Landroid/graphics/Matrix;Landroid/graphics/RectF;Landroid/view/ViewGroup;)Landroid/graphics/Bitmap;
.locals 8
sget-boolean v0, Landroidx/transition/TransitionUtils;->HAS_IS_ATTACHED_TO_WINDOW:Z
const/4 v1, 0x0
if-eqz v0, :cond_1
.line 94
invoke-virtual {p0}, Landroid/view/View;->isAttachedToWindow()Z
move-result v0
xor-int/lit8 v0, v0, 0x1
if-nez p3, :cond_0
move v2, v1
goto :goto_0
.line 95
:cond_0
invoke-virtual {p3}, Landroid/view/ViewGroup;->isAttachedToWindow()Z
move-result v2
goto :goto_0
:cond_1
move v0, v1
move v2, v0
:goto_0
sget-boolean v3, Landroidx/transition/TransitionUtils;->HAS_OVERLAY:Z
const/4 v4, 0x0
if-eqz v3, :cond_3
if-eqz v0, :cond_3
if-nez v2, :cond_2
return-object v4
.line 106
:cond_2
invoke-virtual {p0}, Landroid/view/View;->getParent()Landroid/view/ViewParent;
move-result-object v1
check-cast v1, Landroid/view/ViewGroup;
.line 107
invoke-virtual {v1, p0}, Landroid/view/ViewGroup;->indexOfChild(Landroid/view/View;)I
move-result v2
.line 108
invoke-virtual {p3}, Landroid/view/ViewGroup;->getOverlay()Landroid/view/ViewGroupOverlay;
move-result-object v5
invoke-virtual {v5, p0}, Landroid/view/ViewGroupOverlay;->add(Landroid/view/View;)V
goto :goto_1
:cond_3
move v2, v1
move-object v1, v4
.line 111
:goto_1
invoke-virtual {p2}, Landroid/graphics/RectF;->width()F
move-result v5
invoke-static {v5}, Ljava/lang/Math;->round(F)I
move-result v5
.line 112
invoke-virtual {p2}, Landroid/graphics/RectF;->height()F
move-result v6
invoke-static {v6}, Ljava/lang/Math;->round(F)I
move-result v6
if-lez v5, :cond_5
if-lez v6, :cond_5
mul-int v4, v5, v6
int-to-float v4, v4
const/high16 v7, 0x49800000 # 1048576.0f
div-float/2addr v7, v4
const/high16 v4, 0x3f800000 # 1.0f
.line 114
invoke-static {v4, v7}, Ljava/lang/Math;->min(FF)F
move-result v4
int-to-float v5, v5
mul-float/2addr v5, v4
.line 115
invoke-static {v5}, Ljava/lang/Math;->round(F)I
move-result v5
int-to-float v6, v6
mul-float/2addr v6, v4
.line 116
invoke-static {v6}, Ljava/lang/Math;->round(F)I
move-result v6
.line 117
iget v7, p2, Landroid/graphics/RectF;->left:F
neg-float v7, v7
iget p2, p2, Landroid/graphics/RectF;->top:F
neg-float p2, p2
invoke-virtual {p1, v7, p2}, Landroid/graphics/Matrix;->postTranslate(FF)Z
.line 118
invoke-virtual {p1, v4, v4}, Landroid/graphics/Matrix;->postScale(FF)Z
sget-boolean p2, Landroidx/transition/TransitionUtils;->HAS_PICTURE_BITMAP:Z
if-eqz p2, :cond_4
.line 122
new-instance p2, Landroid/graphics/Picture;
invoke-direct {p2}, Landroid/graphics/Picture;-><init>()V
.line 123
invoke-virtual {p2, v5, v6}, Landroid/graphics/Picture;->beginRecording(II)Landroid/graphics/Canvas;
move-result-object v4
.line 124
invoke-virtual {v4, p1}, Landroid/graphics/Canvas;->concat(Landroid/graphics/Matrix;)V
.line 125
invoke-virtual {p0, v4}, Landroid/view/View;->draw(Landroid/graphics/Canvas;)V
.line 126
invoke-virtual {p2}, Landroid/graphics/Picture;->endRecording()V
.line 127
invoke-static {p2}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Picture;)Landroid/graphics/Bitmap;
move-result-object v4
goto :goto_2
.line 130
:cond_4
sget-object p2, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;
invoke-static {v5, v6, p2}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;
move-result-object v4
.line 131
new-instance p2, Landroid/graphics/Canvas;
invoke-direct {p2, v4}, Landroid/graphics/Canvas;-><init>(Landroid/graphics/Bitmap;)V
.line 132
invoke-virtual {p2, p1}, Landroid/graphics/Canvas;->concat(Landroid/graphics/Matrix;)V
.line 133
invoke-virtual {p0, p2}, Landroid/view/View;->draw(Landroid/graphics/Canvas;)V
:cond_5
:goto_2
if-eqz v3, :cond_6
if-eqz v0, :cond_6
.line 137
invoke-virtual {p3}, Landroid/view/ViewGroup;->getOverlay()Landroid/view/ViewGroupOverlay;
move-result-object p1
invoke-virtual {p1, p0}, Landroid/view/ViewGroupOverlay;->remove(Landroid/view/View;)V
.line 138
invoke-virtual {v1, p0, v2}, Landroid/view/ViewGroup;->addView(Landroid/view/View;I)V
:cond_6
return-object v4
.end method
.method static mergeAnimators(Landroid/animation/Animator;Landroid/animation/Animator;)Landroid/animation/Animator;
.locals 3
if-nez p0, :cond_0
return-object p1
:cond_0
if-nez p1, :cond_1
return-object p0
.line 149
:cond_1
new-instance v0, Landroid/animation/AnimatorSet;
invoke-direct {v0}, Landroid/animation/AnimatorSet;-><init>()V
const/4 v1, 0x2
new-array v1, v1, [Landroid/animation/Animator;
const/4 v2, 0x0
aput-object p0, v1, v2
const/4 p0, 0x1
aput-object p1, v1, p0
.line 150
invoke-virtual {v0, v1}, Landroid/animation/AnimatorSet;->playTogether([Landroid/animation/Animator;)V
return-object v0
.end method