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

550 lines
12 KiB
Smali
Raw Normal View History

2019-07-24 11:27:29 +00:00
.class public Landroidx/transition/Explode;
.super Landroidx/transition/Visibility;
.source "Explode.java"
# static fields
2019-12-06 03:29:40 +00:00
.field public static final PROPNAME_SCREEN_BOUNDS:Ljava/lang/String; = "android:explode:screenBounds"
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static final sAccelerate:Landroid/animation/TimeInterpolator;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static final sDecelerate:Landroid/animation/TimeInterpolator;
2019-07-24 11:27:29 +00:00
# instance fields
2019-12-06 03:29:40 +00:00
.field public mTempLoc:[I
2019-07-24 11:27:29 +00:00
# direct methods
2019-12-06 03:29:40 +00:00
.method public static constructor <clinit>()V
2019-07-24 11:27:29 +00:00
.locals 1
new-instance v0, Landroid/view/animation/DecelerateInterpolator;
invoke-direct {v0}, Landroid/view/animation/DecelerateInterpolator;-><init>()V
sput-object v0, Landroidx/transition/Explode;->sDecelerate:Landroid/animation/TimeInterpolator;
new-instance v0, Landroid/view/animation/AccelerateInterpolator;
invoke-direct {v0}, Landroid/view/animation/AccelerateInterpolator;-><init>()V
sput-object v0, Landroidx/transition/Explode;->sAccelerate:Landroid/animation/TimeInterpolator;
return-void
.end method
.method public constructor <init>()V
.locals 1
invoke-direct {p0}, Landroidx/transition/Visibility;-><init>()V
const/4 v0, 0x2
new-array v0, v0, [I
iput-object v0, p0, Landroidx/transition/Explode;->mTempLoc:[I
new-instance v0, Landroidx/transition/CircularPropagation;
invoke-direct {v0}, Landroidx/transition/CircularPropagation;-><init>()V
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, v0}, Landroidx/transition/Transition;->setPropagation(Landroidx/transition/TransitionPropagation;)V
2019-07-24 11:27:29 +00:00
return-void
.end method
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.locals 0
invoke-direct {p0, p1, p2}, Landroidx/transition/Visibility;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
const/4 p1, 0x2
new-array p1, p1, [I
iput-object p1, p0, Landroidx/transition/Explode;->mTempLoc:[I
new-instance p1, Landroidx/transition/CircularPropagation;
invoke-direct {p1}, Landroidx/transition/CircularPropagation;-><init>()V
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, p1}, Landroidx/transition/Transition;->setPropagation(Landroidx/transition/TransitionPropagation;)V
2019-07-24 11:27:29 +00:00
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public static calculateDistance(FF)F
2019-07-24 11:27:29 +00:00
.locals 0
mul-float p0, p0, p0
mul-float p1, p1, p1
2019-12-06 03:29:40 +00:00
add-float/2addr p1, p0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
float-to-double p0, p1
2019-07-24 11:27:29 +00:00
invoke-static {p0, p1}, Ljava/lang/Math;->sqrt(D)D
move-result-wide p0
double-to-float p0, p0
return p0
.end method
2019-12-06 03:29:40 +00:00
.method public static calculateMaxDistance(Landroid/view/View;II)F
2019-07-24 11:27:29 +00:00
.locals 1
invoke-virtual {p0}, Landroid/view/View;->getWidth()I
move-result v0
sub-int/2addr v0, p1
invoke-static {p1, v0}, Ljava/lang/Math;->max(II)I
move-result p1
invoke-virtual {p0}, Landroid/view/View;->getHeight()I
move-result p0
sub-int/2addr p0, p2
invoke-static {p2, p0}, Ljava/lang/Math;->max(II)I
move-result p0
int-to-float p1, p1
int-to-float p0, p0
invoke-static {p1, p0}, Landroidx/transition/Explode;->calculateDistance(FF)F
move-result p0
return p0
.end method
.method private calculateOut(Landroid/view/View;Landroid/graphics/Rect;[I)V
2019-12-06 03:29:40 +00:00
.locals 12
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget-object v0, p0, Landroidx/transition/Explode;->mTempLoc:[I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p1, v0}, Landroid/view/View;->getLocationOnScreen([I)V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
iget-object v0, p0, Landroidx/transition/Explode;->mTempLoc:[I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/4 v1, 0x0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
aget v2, v0, v1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/4 v3, 0x1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
aget v0, v0, v3
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroidx/transition/Transition;->getEpicenter()Landroid/graphics/Rect;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result-object v4
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
if-nez v4, :cond_0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p1}, Landroid/view/View;->getWidth()I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result v4
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
div-int/lit8 v4, v4, 0x2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
add-int/2addr v4, v2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p1}, Landroid/view/View;->getTranslationX()F
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result v5
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {v5}, Ljava/lang/Math;->round(F)I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result v5
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
add-int/2addr v5, v4
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p1}, Landroid/view/View;->getHeight()I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result v4
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
div-int/lit8 v4, v4, 0x2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
add-int/2addr v4, v0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p1}, Landroid/view/View;->getTranslationY()F
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result v6
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {v6}, Ljava/lang/Math;->round(F)I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result v6
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
add-int/2addr v6, v4
2019-07-24 11:27:29 +00:00
goto :goto_0
:cond_0
2019-12-06 03:29:40 +00:00
invoke-virtual {v4}, Landroid/graphics/Rect;->centerX()I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result v5
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {v4}, Landroid/graphics/Rect;->centerY()I
2019-07-24 11:27:29 +00:00
move-result v6
:goto_0
2019-12-06 03:29:40 +00:00
invoke-virtual {p2}, Landroid/graphics/Rect;->centerX()I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result v4
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p2}, Landroid/graphics/Rect;->centerY()I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result p2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
sub-int/2addr v4, v5
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
int-to-float v4, v4
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
sub-int/2addr p2, v6
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
int-to-float p2, p2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/4 v7, 0x0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
cmpl-float v8, v4, v7
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
if-nez v8, :cond_1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
cmpl-float v7, p2, v7
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
if-nez v7, :cond_1
2019-07-24 11:27:29 +00:00
invoke-static {}, Ljava/lang/Math;->random()D
2019-12-06 03:29:40 +00:00
move-result-wide v7
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const-wide/high16 v9, 0x4000000000000000L # 2.0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
mul-double v7, v7, v9
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
double-to-float p2, v7
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/high16 v4, 0x3f800000 # 1.0f
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
sub-float/2addr p2, v4
2019-07-24 11:27:29 +00:00
invoke-static {}, Ljava/lang/Math;->random()D
2019-12-06 03:29:40 +00:00
move-result-wide v7
mul-double v7, v7, v9
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
double-to-float v7, v7
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
sub-float v4, v7, v4
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
goto :goto_1
2019-07-24 11:27:29 +00:00
:cond_1
2019-12-06 03:29:40 +00:00
move v11, v4
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move v4, p2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move p2, v11
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
:goto_1
invoke-static {p2, v4}, Landroidx/transition/Explode;->calculateDistance(FF)F
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result v7
div-float/2addr p2, v7
div-float/2addr v4, v7
sub-int/2addr v5, v2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
sub-int/2addr v6, v0
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {p1, v5, v6}, Landroidx/transition/Explode;->calculateMaxDistance(Landroid/view/View;II)F
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result p1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
mul-float p2, p2, p1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {p2}, Ljava/lang/Math;->round(F)I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result p2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
aput p2, p3, v1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
mul-float p1, p1, v4
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-static {p1}, Ljava/lang/Math;->round(F)I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
move-result p1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
aput p1, p3, v3
2019-07-24 11:27:29 +00:00
return-void
.end method
.method private captureValues(Landroidx/transition/TransitionValues;)V
.locals 5
iget-object v0, p1, Landroidx/transition/TransitionValues;->view:Landroid/view/View;
iget-object v1, p0, Landroidx/transition/Explode;->mTempLoc:[I
invoke-virtual {v0, v1}, Landroid/view/View;->getLocationOnScreen([I)V
iget-object v1, p0, Landroidx/transition/Explode;->mTempLoc:[I
const/4 v2, 0x0
aget v2, v1, v2
const/4 v3, 0x1
aget v1, v1, v3
invoke-virtual {v0}, Landroid/view/View;->getWidth()I
move-result v3
add-int/2addr v3, v2
invoke-virtual {v0}, Landroid/view/View;->getHeight()I
move-result v0
add-int/2addr v0, v1
iget-object p1, p1, Landroidx/transition/TransitionValues;->values:Ljava/util/Map;
new-instance v4, Landroid/graphics/Rect;
invoke-direct {v4, v2, v1, v3, v0}, Landroid/graphics/Rect;-><init>(IIII)V
const-string v0, "android:explode:screenBounds"
invoke-interface {p1, v0, v4}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
return-void
.end method
# virtual methods
.method public captureEndValues(Landroidx/transition/TransitionValues;)V
.locals 0
2019-12-06 03:29:40 +00:00
.param p1 # Landroidx/transition/TransitionValues;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
2019-07-24 11:27:29 +00:00
invoke-super {p0, p1}, Landroidx/transition/Visibility;->captureEndValues(Landroidx/transition/TransitionValues;)V
invoke-direct {p0, p1}, Landroidx/transition/Explode;->captureValues(Landroidx/transition/TransitionValues;)V
return-void
.end method
.method public captureStartValues(Landroidx/transition/TransitionValues;)V
.locals 0
2019-12-06 03:29:40 +00:00
.param p1 # Landroidx/transition/TransitionValues;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
2019-07-24 11:27:29 +00:00
invoke-super {p0, p1}, Landroidx/transition/Visibility;->captureStartValues(Landroidx/transition/TransitionValues;)V
invoke-direct {p0, p1}, Landroidx/transition/Explode;->captureValues(Landroidx/transition/TransitionValues;)V
return-void
.end method
.method public onAppear(Landroid/view/ViewGroup;Landroid/view/View;Landroidx/transition/TransitionValues;Landroidx/transition/TransitionValues;)Landroid/animation/Animator;
.locals 9
if-nez p4, :cond_0
const/4 p1, 0x0
return-object p1
:cond_0
iget-object p3, p4, Landroidx/transition/TransitionValues;->values:Ljava/util/Map;
const-string v0, "android:explode:screenBounds"
invoke-interface {p3, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p3
check-cast p3, Landroid/graphics/Rect;
invoke-virtual {p2}, Landroid/view/View;->getTranslationX()F
move-result v6
invoke-virtual {p2}, Landroid/view/View;->getTranslationY()F
move-result v7
iget-object v0, p0, Landroidx/transition/Explode;->mTempLoc:[I
invoke-direct {p0, p1, p3, v0}, Landroidx/transition/Explode;->calculateOut(Landroid/view/View;Landroid/graphics/Rect;[I)V
iget-object p1, p0, Landroidx/transition/Explode;->mTempLoc:[I
const/4 v0, 0x0
aget v0, p1, v0
int-to-float v0, v0
add-float v4, v6, v0
const/4 v0, 0x1
aget p1, p1, v0
int-to-float p1, p1
add-float v5, v7, p1
iget v2, p3, Landroid/graphics/Rect;->left:I
iget v3, p3, Landroid/graphics/Rect;->top:I
sget-object v8, Landroidx/transition/Explode;->sDecelerate:Landroid/animation/TimeInterpolator;
move-object v0, p2
move-object v1, p4
invoke-static/range {v0 .. v8}, Landroidx/transition/TranslationAnimationCreator;->createAnimation(Landroid/view/View;Landroidx/transition/TransitionValues;IIFFFFLandroid/animation/TimeInterpolator;)Landroid/animation/Animator;
move-result-object p1
return-object p1
.end method
.method public onDisappear(Landroid/view/ViewGroup;Landroid/view/View;Landroidx/transition/TransitionValues;Landroidx/transition/TransitionValues;)Landroid/animation/Animator;
.locals 10
if-nez p3, :cond_0
const/4 p1, 0x0
return-object p1
:cond_0
iget-object p4, p3, Landroidx/transition/TransitionValues;->values:Ljava/util/Map;
const-string v0, "android:explode:screenBounds"
invoke-interface {p4, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object p4
check-cast p4, Landroid/graphics/Rect;
iget v2, p4, Landroid/graphics/Rect;->left:I
iget v3, p4, Landroid/graphics/Rect;->top:I
invoke-virtual {p2}, Landroid/view/View;->getTranslationX()F
move-result v4
invoke-virtual {p2}, Landroid/view/View;->getTranslationY()F
move-result v5
iget-object v0, p3, Landroidx/transition/TransitionValues;->view:Landroid/view/View;
sget v1, Landroidx/transition/R$id;->transition_position:I
invoke-virtual {v0, v1}, Landroid/view/View;->getTag(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, [I
const/4 v1, 0x1
const/4 v6, 0x0
if-eqz v0, :cond_1
aget v7, v0, v6
iget v8, p4, Landroid/graphics/Rect;->left:I
sub-int/2addr v7, v8
int-to-float v7, v7
add-float/2addr v7, v4
aget v8, v0, v1
iget v9, p4, Landroid/graphics/Rect;->top:I
sub-int/2addr v8, v9
int-to-float v8, v8
add-float/2addr v8, v5
aget v9, v0, v6
aget v0, v0, v1
invoke-virtual {p4, v9, v0}, Landroid/graphics/Rect;->offsetTo(II)V
goto :goto_0
:cond_1
move v7, v4
move v8, v5
:goto_0
iget-object v0, p0, Landroidx/transition/Explode;->mTempLoc:[I
invoke-direct {p0, p1, p4, v0}, Landroidx/transition/Explode;->calculateOut(Landroid/view/View;Landroid/graphics/Rect;[I)V
iget-object p1, p0, Landroidx/transition/Explode;->mTempLoc:[I
aget p4, p1, v6
int-to-float p4, p4
add-float v6, v7, p4
aget p1, p1, v1
int-to-float p1, p1
add-float v7, v8, p1
sget-object v8, Landroidx/transition/Explode;->sAccelerate:Landroid/animation/TimeInterpolator;
move-object v0, p2
move-object v1, p3
invoke-static/range {v0 .. v8}, Landroidx/transition/TranslationAnimationCreator;->createAnimation(Landroid/view/View;Landroidx/transition/TransitionValues;IIFFFFLandroid/animation/TimeInterpolator;)Landroid/animation/Animator;
move-result-object p1
return-object p1
.end method