apkfuckery/com.discord/smali/androidx/customview/widget/ViewDragHelper.smali

3308 lines
77 KiB
Smali
Raw Normal View History

2019-02-04 20:08:30 +00:00
.class public Landroidx/customview/widget/ViewDragHelper;
.super Ljava/lang/Object;
2019-02-04 20:29:01 +00:00
.source "ViewDragHelper.java"
2019-02-04 20:08:30 +00:00
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/customview/widget/ViewDragHelper$Callback;
}
.end annotation
# static fields
.field private static final BASE_SETTLE_DURATION:I = 0x100
.field public static final DIRECTION_ALL:I = 0x3
.field public static final DIRECTION_HORIZONTAL:I = 0x1
.field public static final DIRECTION_VERTICAL:I = 0x2
.field public static final EDGE_ALL:I = 0xf
.field public static final EDGE_BOTTOM:I = 0x8
.field public static final EDGE_LEFT:I = 0x1
.field public static final EDGE_RIGHT:I = 0x2
.field private static final EDGE_SIZE:I = 0x14
.field public static final EDGE_TOP:I = 0x4
.field public static final INVALID_POINTER:I = -0x1
.field private static final MAX_SETTLE_DURATION:I = 0x258
.field public static final STATE_DRAGGING:I = 0x1
.field public static final STATE_IDLE:I = 0x0
.field public static final STATE_SETTLING:I = 0x2
.field private static final TAG:Ljava/lang/String; = "ViewDragHelper"
.field private static final sInterpolator:Landroid/view/animation/Interpolator;
# instance fields
.field private mActivePointerId:I
.field private final mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
.field private mCapturedView:Landroid/view/View;
.field private mDragState:I
.field private mEdgeDragsInProgress:[I
.field private mEdgeDragsLocked:[I
.field private mEdgeSize:I
.field private mInitialEdgesTouched:[I
.field private mInitialMotionX:[F
.field private mInitialMotionY:[F
.field private mLastMotionX:[F
.field private mLastMotionY:[F
.field private mMaxVelocity:F
.field private mMinVelocity:F
.field private final mParentView:Landroid/view/ViewGroup;
.field private mPointersDown:I
.field private mReleaseInProgress:Z
.field private mScroller:Landroid/widget/OverScroller;
.field private final mSetIdleRunnable:Ljava/lang/Runnable;
.field private mTouchSlop:I
.field private mTrackingEdges:I
.field private mVelocityTracker:Landroid/view/VelocityTracker;
# direct methods
.method static constructor <clinit>()V
.locals 1
new-instance v0, Landroidx/customview/widget/ViewDragHelper$1;
invoke-direct {v0}, Landroidx/customview/widget/ViewDragHelper$1;-><init>()V
sput-object v0, Landroidx/customview/widget/ViewDragHelper;->sInterpolator:Landroid/view/animation/Interpolator;
return-void
.end method
.method private constructor <init>(Landroid/content/Context;Landroid/view/ViewGroup;Landroidx/customview/widget/ViewDragHelper$Callback;)V
.locals 1
.param p1 # Landroid/content/Context;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Landroid/view/ViewGroup;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p3 # Landroidx/customview/widget/ViewDragHelper$Callback;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const/4 v0, -0x1
iput v0, p0, Landroidx/customview/widget/ViewDragHelper;->mActivePointerId:I
new-instance v0, Landroidx/customview/widget/ViewDragHelper$2;
invoke-direct {v0, p0}, Landroidx/customview/widget/ViewDragHelper$2;-><init>(Landroidx/customview/widget/ViewDragHelper;)V
iput-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mSetIdleRunnable:Ljava/lang/Runnable;
if-eqz p2, :cond_1
if-eqz p3, :cond_0
iput-object p2, p0, Landroidx/customview/widget/ViewDragHelper;->mParentView:Landroid/view/ViewGroup;
iput-object p3, p0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
invoke-static {p1}, Landroid/view/ViewConfiguration;->get(Landroid/content/Context;)Landroid/view/ViewConfiguration;
move-result-object p2
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object p3
invoke-virtual {p3}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
move-result-object p3
iget p3, p3, Landroid/util/DisplayMetrics;->density:F
const/high16 v0, 0x41a00000 # 20.0f
mul-float p3, p3, v0
const/high16 v0, 0x3f000000 # 0.5f
add-float/2addr p3, v0
float-to-int p3, p3
iput p3, p0, Landroidx/customview/widget/ViewDragHelper;->mEdgeSize:I
invoke-virtual {p2}, Landroid/view/ViewConfiguration;->getScaledTouchSlop()I
move-result p3
iput p3, p0, Landroidx/customview/widget/ViewDragHelper;->mTouchSlop:I
invoke-virtual {p2}, Landroid/view/ViewConfiguration;->getScaledMaximumFlingVelocity()I
move-result p3
int-to-float p3, p3
iput p3, p0, Landroidx/customview/widget/ViewDragHelper;->mMaxVelocity:F
invoke-virtual {p2}, Landroid/view/ViewConfiguration;->getScaledMinimumFlingVelocity()I
move-result p2
int-to-float p2, p2
iput p2, p0, Landroidx/customview/widget/ViewDragHelper;->mMinVelocity:F
new-instance p2, Landroid/widget/OverScroller;
sget-object p3, Landroidx/customview/widget/ViewDragHelper;->sInterpolator:Landroid/view/animation/Interpolator;
invoke-direct {p2, p1, p3}, Landroid/widget/OverScroller;-><init>(Landroid/content/Context;Landroid/view/animation/Interpolator;)V
iput-object p2, p0, Landroidx/customview/widget/ViewDragHelper;->mScroller:Landroid/widget/OverScroller;
return-void
:cond_0
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string p2, "Callback may not be null"
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
:cond_1
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string p2, "Parent view may not be null"
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method private checkNewEdgeDrag(FFII)Z
2019-02-04 20:29:01 +00:00
.locals 3
2019-02-04 20:08:30 +00:00
invoke-static {p1}, Ljava/lang/Math;->abs(F)F
move-result p1
invoke-static {p2}, Ljava/lang/Math;->abs(F)F
move-result p2
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialEdgesTouched:[I
aget v0, v0, p3
and-int/2addr v0, p4
const/4 v1, 0x0
2019-02-04 20:29:01 +00:00
if-ne v0, p4, :cond_3
2019-02-04 20:08:30 +00:00
iget v0, p0, Landroidx/customview/widget/ViewDragHelper;->mTrackingEdges:I
and-int/2addr v0, p4
2019-02-04 20:29:01 +00:00
if-eqz v0, :cond_3
2019-02-04 20:08:30 +00:00
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mEdgeDragsLocked:[I
aget v0, v0, p3
and-int/2addr v0, p4
2019-02-04 20:29:01 +00:00
if-eq v0, p4, :cond_3
2019-02-04 20:08:30 +00:00
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mEdgeDragsInProgress:[I
aget v0, v0, p3
and-int/2addr v0, p4
2019-02-04 20:29:01 +00:00
if-eq v0, p4, :cond_3
2019-02-04 20:08:30 +00:00
iget v0, p0, Landroidx/customview/widget/ViewDragHelper;->mTouchSlop:I
2019-02-04 20:29:01 +00:00
int-to-float v2, v0
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
cmpg-float v2, p1, v2
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
if-gtz v2, :cond_0
2019-02-04 20:08:30 +00:00
int-to-float v0, v0
cmpg-float v0, p2, v0
if-gtz v0, :cond_0
goto :goto_0
:cond_0
const/high16 v0, 0x3f000000 # 0.5f
mul-float p2, p2, v0
cmpg-float p2, p1, p2
if-gez p2, :cond_1
iget-object p2, p0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
invoke-virtual {p2, p4}, Landroidx/customview/widget/ViewDragHelper$Callback;->onEdgeLock(I)Z
move-result p2
if-eqz p2, :cond_1
iget-object p1, p0, Landroidx/customview/widget/ViewDragHelper;->mEdgeDragsLocked:[I
aget p2, p1, p3
or-int/2addr p2, p4
aput p2, p1, p3
return v1
:cond_1
iget-object p2, p0, Landroidx/customview/widget/ViewDragHelper;->mEdgeDragsInProgress:[I
aget p2, p2, p3
and-int/2addr p2, p4
if-nez p2, :cond_2
iget p2, p0, Landroidx/customview/widget/ViewDragHelper;->mTouchSlop:I
int-to-float p2, p2
cmpl-float p1, p1, p2
if-lez p1, :cond_2
const/4 p1, 0x1
return p1
:cond_2
2019-02-04 20:29:01 +00:00
return v1
:cond_3
2019-02-04 20:08:30 +00:00
:goto_0
return v1
.end method
.method private checkTouchSlop(Landroid/view/View;FF)Z
.locals 4
const/4 v0, 0x0
if-nez p1, :cond_0
return v0
:cond_0
iget-object v1, p0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
invoke-virtual {v1, p1}, Landroidx/customview/widget/ViewDragHelper$Callback;->getViewHorizontalDragRange(Landroid/view/View;)I
move-result v1
const/4 v2, 0x1
if-lez v1, :cond_1
const/4 v1, 0x1
goto :goto_0
:cond_1
const/4 v1, 0x0
:goto_0
iget-object v3, p0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
invoke-virtual {v3, p1}, Landroidx/customview/widget/ViewDragHelper$Callback;->getViewVerticalDragRange(Landroid/view/View;)I
move-result p1
if-lez p1, :cond_2
const/4 p1, 0x1
goto :goto_1
:cond_2
const/4 p1, 0x0
:goto_1
if-eqz v1, :cond_4
if-eqz p1, :cond_4
mul-float p2, p2, p2
mul-float p3, p3, p3
add-float/2addr p2, p3
iget p1, p0, Landroidx/customview/widget/ViewDragHelper;->mTouchSlop:I
2019-02-04 20:29:01 +00:00
mul-int p1, p1, p1
2019-02-04 20:08:30 +00:00
int-to-float p1, p1
cmpl-float p1, p2, p1
if-lez p1, :cond_3
return v2
:cond_3
return v0
:cond_4
if-eqz v1, :cond_6
invoke-static {p2}, Ljava/lang/Math;->abs(F)F
move-result p1
iget p2, p0, Landroidx/customview/widget/ViewDragHelper;->mTouchSlop:I
int-to-float p2, p2
cmpl-float p1, p1, p2
if-lez p1, :cond_5
return v2
:cond_5
return v0
:cond_6
2019-02-04 20:29:01 +00:00
if-eqz p1, :cond_8
2019-02-04 20:08:30 +00:00
invoke-static {p3}, Ljava/lang/Math;->abs(F)F
move-result p1
iget p2, p0, Landroidx/customview/widget/ViewDragHelper;->mTouchSlop:I
int-to-float p2, p2
cmpl-float p1, p1, p2
if-lez p1, :cond_7
return v2
:cond_7
return v0
2019-02-04 20:29:01 +00:00
:cond_8
return v0
2019-02-04 20:08:30 +00:00
.end method
.method private clampMag(FFF)F
.locals 2
invoke-static {p1}, Ljava/lang/Math;->abs(F)F
move-result v0
const/4 v1, 0x0
cmpg-float p2, v0, p2
if-gez p2, :cond_0
return v1
:cond_0
cmpl-float p2, v0, p3
if-lez p2, :cond_2
cmpl-float p1, p1, v1
if-lez p1, :cond_1
return p3
:cond_1
neg-float p1, p3
2019-02-04 20:29:01 +00:00
return p1
2019-02-04 20:08:30 +00:00
:cond_2
return p1
.end method
.method private clampMag(III)I
.locals 1
invoke-static {p1}, Ljava/lang/Math;->abs(I)I
move-result v0
if-ge v0, p2, :cond_0
const/4 p1, 0x0
return p1
:cond_0
if-le v0, p3, :cond_2
if-lez p1, :cond_1
return p3
:cond_1
neg-int p1, p3
2019-02-04 20:29:01 +00:00
return p1
2019-02-04 20:08:30 +00:00
:cond_2
return p1
.end method
.method private clearMotionHistory()V
.locals 2
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionX:[F
if-nez v0, :cond_0
return-void
:cond_0
const/4 v1, 0x0
invoke-static {v0, v1}, Ljava/util/Arrays;->fill([FF)V
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionY:[F
invoke-static {v0, v1}, Ljava/util/Arrays;->fill([FF)V
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mLastMotionX:[F
invoke-static {v0, v1}, Ljava/util/Arrays;->fill([FF)V
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mLastMotionY:[F
invoke-static {v0, v1}, Ljava/util/Arrays;->fill([FF)V
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialEdgesTouched:[I
const/4 v1, 0x0
invoke-static {v0, v1}, Ljava/util/Arrays;->fill([II)V
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mEdgeDragsInProgress:[I
invoke-static {v0, v1}, Ljava/util/Arrays;->fill([II)V
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mEdgeDragsLocked:[I
invoke-static {v0, v1}, Ljava/util/Arrays;->fill([II)V
iput v1, p0, Landroidx/customview/widget/ViewDragHelper;->mPointersDown:I
return-void
.end method
.method private clearMotionHistory(I)V
.locals 2
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionX:[F
if-eqz v0, :cond_1
invoke-virtual {p0, p1}, Landroidx/customview/widget/ViewDragHelper;->isPointerDown(I)Z
move-result v0
if-nez v0, :cond_0
goto :goto_0
:cond_0
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionX:[F
const/4 v1, 0x0
aput v1, v0, p1
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionY:[F
aput v1, v0, p1
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mLastMotionX:[F
aput v1, v0, p1
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mLastMotionY:[F
aput v1, v0, p1
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialEdgesTouched:[I
const/4 v1, 0x0
aput v1, v0, p1
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mEdgeDragsInProgress:[I
aput v1, v0, p1
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mEdgeDragsLocked:[I
aput v1, v0, p1
iget v0, p0, Landroidx/customview/widget/ViewDragHelper;->mPointersDown:I
const/4 v1, 0x1
shl-int p1, v1, p1
xor-int/lit8 p1, p1, -0x1
and-int/2addr p1, v0
iput p1, p0, Landroidx/customview/widget/ViewDragHelper;->mPointersDown:I
2019-02-04 20:29:01 +00:00
return-void
2019-02-04 20:08:30 +00:00
:cond_1
:goto_0
return-void
.end method
.method private computeAxisDuration(III)I
.locals 3
if-nez p1, :cond_0
const/4 p1, 0x0
return p1
:cond_0
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mParentView:Landroid/view/ViewGroup;
invoke-virtual {v0}, Landroid/view/ViewGroup;->getWidth()I
move-result v0
div-int/lit8 v1, v0, 0x2
invoke-static {p1}, Ljava/lang/Math;->abs(I)I
move-result v2
int-to-float v2, v2
int-to-float v0, v0
div-float/2addr v2, v0
const/high16 v0, 0x3f800000 # 1.0f
invoke-static {v0, v2}, Ljava/lang/Math;->min(FF)F
move-result v2
int-to-float v1, v1
invoke-direct {p0, v2}, Landroidx/customview/widget/ViewDragHelper;->distanceInfluenceForSnapDuration(F)F
move-result v2
mul-float v2, v2, v1
add-float/2addr v1, v2
invoke-static {p2}, Ljava/lang/Math;->abs(I)I
move-result p2
if-lez p2, :cond_1
const/high16 p1, 0x447a0000 # 1000.0f
int-to-float p2, p2
div-float/2addr v1, p2
invoke-static {v1}, Ljava/lang/Math;->abs(F)F
move-result p2
mul-float p2, p2, p1
invoke-static {p2}, Ljava/lang/Math;->round(F)I
move-result p1
mul-int/lit8 p1, p1, 0x4
goto :goto_0
:cond_1
invoke-static {p1}, Ljava/lang/Math;->abs(I)I
move-result p1
int-to-float p1, p1
int-to-float p2, p3
div-float/2addr p1, p2
add-float/2addr p1, v0
const/high16 p2, 0x43800000 # 256.0f
mul-float p1, p1, p2
float-to-int p1, p1
:goto_0
const/16 p2, 0x258
invoke-static {p1, p2}, Ljava/lang/Math;->min(II)I
move-result p1
return p1
.end method
.method private computeSettleDuration(Landroid/view/View;IIII)I
.locals 6
iget v0, p0, Landroidx/customview/widget/ViewDragHelper;->mMinVelocity:F
float-to-int v0, v0
iget v1, p0, Landroidx/customview/widget/ViewDragHelper;->mMaxVelocity:F
float-to-int v1, v1
invoke-direct {p0, p4, v0, v1}, Landroidx/customview/widget/ViewDragHelper;->clampMag(III)I
move-result p4
iget v0, p0, Landroidx/customview/widget/ViewDragHelper;->mMinVelocity:F
float-to-int v0, v0
iget v1, p0, Landroidx/customview/widget/ViewDragHelper;->mMaxVelocity:F
float-to-int v1, v1
invoke-direct {p0, p5, v0, v1}, Landroidx/customview/widget/ViewDragHelper;->clampMag(III)I
move-result p5
invoke-static {p2}, Ljava/lang/Math;->abs(I)I
move-result v0
invoke-static {p3}, Ljava/lang/Math;->abs(I)I
move-result v1
invoke-static {p4}, Ljava/lang/Math;->abs(I)I
move-result v2
invoke-static {p5}, Ljava/lang/Math;->abs(I)I
move-result v3
add-int v4, v2, v3
add-int v5, v0, v1
if-eqz p4, :cond_0
int-to-float v0, v2
int-to-float v2, v4
2019-02-04 20:29:01 +00:00
goto :goto_0
2019-02-04 20:08:30 +00:00
:cond_0
int-to-float v0, v0
int-to-float v2, v5
2019-02-04 20:29:01 +00:00
:goto_0
div-float/2addr v0, v2
2019-02-04 20:08:30 +00:00
if-eqz p5, :cond_1
int-to-float v1, v3
int-to-float v2, v4
2019-02-04 20:29:01 +00:00
goto :goto_1
2019-02-04 20:08:30 +00:00
:cond_1
int-to-float v1, v1
int-to-float v2, v5
2019-02-04 20:29:01 +00:00
:goto_1
div-float/2addr v1, v2
2019-02-04 20:08:30 +00:00
iget-object v2, p0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
invoke-virtual {v2, p1}, Landroidx/customview/widget/ViewDragHelper$Callback;->getViewHorizontalDragRange(Landroid/view/View;)I
move-result v2
invoke-direct {p0, p2, p4, v2}, Landroidx/customview/widget/ViewDragHelper;->computeAxisDuration(III)I
move-result p2
iget-object p4, p0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
invoke-virtual {p4, p1}, Landroidx/customview/widget/ViewDragHelper$Callback;->getViewVerticalDragRange(Landroid/view/View;)I
move-result p1
invoke-direct {p0, p3, p5, p1}, Landroidx/customview/widget/ViewDragHelper;->computeAxisDuration(III)I
move-result p1
int-to-float p2, p2
mul-float p2, p2, v0
int-to-float p1, p1
mul-float p1, p1, v1
add-float/2addr p2, p1
float-to-int p1, p2
return p1
.end method
.method public static create(Landroid/view/ViewGroup;FLandroidx/customview/widget/ViewDragHelper$Callback;)Landroidx/customview/widget/ViewDragHelper;
.locals 1
.param p0 # Landroid/view/ViewGroup;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Landroidx/customview/widget/ViewDragHelper$Callback;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
invoke-static {p0, p2}, Landroidx/customview/widget/ViewDragHelper;->create(Landroid/view/ViewGroup;Landroidx/customview/widget/ViewDragHelper$Callback;)Landroidx/customview/widget/ViewDragHelper;
move-result-object p0
iget p2, p0, Landroidx/customview/widget/ViewDragHelper;->mTouchSlop:I
int-to-float p2, p2
const/high16 v0, 0x3f800000 # 1.0f
div-float/2addr v0, p1
mul-float p2, p2, v0
float-to-int p1, p2
iput p1, p0, Landroidx/customview/widget/ViewDragHelper;->mTouchSlop:I
return-object p0
.end method
.method public static create(Landroid/view/ViewGroup;Landroidx/customview/widget/ViewDragHelper$Callback;)Landroidx/customview/widget/ViewDragHelper;
.locals 2
.param p0 # Landroid/view/ViewGroup;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p1 # Landroidx/customview/widget/ViewDragHelper$Callback;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
new-instance v0, Landroidx/customview/widget/ViewDragHelper;
invoke-virtual {p0}, Landroid/view/ViewGroup;->getContext()Landroid/content/Context;
move-result-object v1
invoke-direct {v0, v1, p0, p1}, Landroidx/customview/widget/ViewDragHelper;-><init>(Landroid/content/Context;Landroid/view/ViewGroup;Landroidx/customview/widget/ViewDragHelper$Callback;)V
return-object v0
.end method
.method private dispatchViewReleased(FF)V
.locals 3
const/4 v0, 0x1
iput-boolean v0, p0, Landroidx/customview/widget/ViewDragHelper;->mReleaseInProgress:Z
iget-object v1, p0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
iget-object v2, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
invoke-virtual {v1, v2, p1, p2}, Landroidx/customview/widget/ViewDragHelper$Callback;->onViewReleased(Landroid/view/View;FF)V
const/4 p1, 0x0
iput-boolean p1, p0, Landroidx/customview/widget/ViewDragHelper;->mReleaseInProgress:Z
iget p2, p0, Landroidx/customview/widget/ViewDragHelper;->mDragState:I
if-ne p2, v0, :cond_0
invoke-virtual {p0, p1}, Landroidx/customview/widget/ViewDragHelper;->setDragState(I)V
:cond_0
return-void
.end method
.method private distanceInfluenceForSnapDuration(F)F
.locals 2
const/high16 v0, 0x3f000000 # 0.5f
sub-float/2addr p1, v0
const v0, 0x3ef1463b
mul-float p1, p1, v0
float-to-double v0, p1
invoke-static {v0, v1}, Ljava/lang/Math;->sin(D)D
move-result-wide v0
double-to-float p1, v0
return p1
.end method
.method private dragTo(IIII)V
.locals 10
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
invoke-virtual {v0}, Landroid/view/View;->getLeft()I
move-result v0
iget-object v1, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
invoke-virtual {v1}, Landroid/view/View;->getTop()I
move-result v1
if-eqz p3, :cond_0
iget-object v2, p0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
iget-object v3, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
invoke-virtual {v2, v3, p1, p3}, Landroidx/customview/widget/ViewDragHelper$Callback;->clampViewPositionHorizontal(Landroid/view/View;II)I
move-result p1
iget-object v2, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
sub-int v3, p1, v0
invoke-static {v2, v3}, Landroidx/core/view/ViewCompat;->offsetLeftAndRight(Landroid/view/View;I)V
2019-02-04 20:29:01 +00:00
move v6, p1
goto :goto_0
2019-02-04 20:08:30 +00:00
:cond_0
move v6, p1
2019-02-04 20:29:01 +00:00
:goto_0
2019-02-04 20:08:30 +00:00
if-eqz p4, :cond_1
iget-object p1, p0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
iget-object v2, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
invoke-virtual {p1, v2, p2, p4}, Landroidx/customview/widget/ViewDragHelper$Callback;->clampViewPositionVertical(Landroid/view/View;II)I
move-result p2
iget-object p1, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
sub-int v2, p2, v1
invoke-static {p1, v2}, Landroidx/core/view/ViewCompat;->offsetTopAndBottom(Landroid/view/View;I)V
2019-02-04 20:29:01 +00:00
move v7, p2
goto :goto_1
2019-02-04 20:08:30 +00:00
:cond_1
move v7, p2
2019-02-04 20:29:01 +00:00
:goto_1
2019-02-04 20:08:30 +00:00
if-nez p3, :cond_2
if-eqz p4, :cond_3
:cond_2
sub-int v8, v6, v0
sub-int v9, v7, v1
iget-object v4, p0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
iget-object v5, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
invoke-virtual/range {v4 .. v9}, Landroidx/customview/widget/ViewDragHelper$Callback;->onViewPositionChanged(Landroid/view/View;IIII)V
:cond_3
return-void
.end method
.method private ensureMotionHistorySizeForId(I)V
.locals 9
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionX:[F
if-eqz v0, :cond_0
array-length v0, v0
if-gt v0, p1, :cond_2
:cond_0
add-int/lit8 p1, p1, 0x1
new-array v0, p1, [F
new-array v1, p1, [F
new-array v2, p1, [F
new-array v3, p1, [F
new-array v4, p1, [I
new-array v5, p1, [I
new-array p1, p1, [I
iget-object v6, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionX:[F
if-eqz v6, :cond_1
2019-02-04 20:29:01 +00:00
array-length v7, v6
2019-02-04 20:08:30 +00:00
const/4 v8, 0x0
invoke-static {v6, v8, v0, v8, v7}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
iget-object v6, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionY:[F
2019-02-04 20:29:01 +00:00
array-length v7, v6
2019-02-04 20:08:30 +00:00
invoke-static {v6, v8, v1, v8, v7}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
iget-object v6, p0, Landroidx/customview/widget/ViewDragHelper;->mLastMotionX:[F
2019-02-04 20:29:01 +00:00
array-length v7, v6
2019-02-04 20:08:30 +00:00
invoke-static {v6, v8, v2, v8, v7}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
iget-object v6, p0, Landroidx/customview/widget/ViewDragHelper;->mLastMotionY:[F
2019-02-04 20:29:01 +00:00
array-length v7, v6
2019-02-04 20:08:30 +00:00
invoke-static {v6, v8, v3, v8, v7}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
iget-object v6, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialEdgesTouched:[I
2019-02-04 20:29:01 +00:00
array-length v7, v6
2019-02-04 20:08:30 +00:00
invoke-static {v6, v8, v4, v8, v7}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
iget-object v6, p0, Landroidx/customview/widget/ViewDragHelper;->mEdgeDragsInProgress:[I
2019-02-04 20:29:01 +00:00
array-length v7, v6
2019-02-04 20:08:30 +00:00
invoke-static {v6, v8, v5, v8, v7}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
iget-object v6, p0, Landroidx/customview/widget/ViewDragHelper;->mEdgeDragsLocked:[I
2019-02-04 20:29:01 +00:00
array-length v7, v6
2019-02-04 20:08:30 +00:00
invoke-static {v6, v8, p1, v8, v7}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
:cond_1
iput-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionX:[F
iput-object v1, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionY:[F
iput-object v2, p0, Landroidx/customview/widget/ViewDragHelper;->mLastMotionX:[F
iput-object v3, p0, Landroidx/customview/widget/ViewDragHelper;->mLastMotionY:[F
iput-object v4, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialEdgesTouched:[I
iput-object v5, p0, Landroidx/customview/widget/ViewDragHelper;->mEdgeDragsInProgress:[I
iput-object p1, p0, Landroidx/customview/widget/ViewDragHelper;->mEdgeDragsLocked:[I
:cond_2
return-void
.end method
.method private forceSettleCapturedViewAt(IIII)Z
.locals 10
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
invoke-virtual {v0}, Landroid/view/View;->getLeft()I
move-result v2
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
invoke-virtual {v0}, Landroid/view/View;->getTop()I
move-result v3
sub-int/2addr p1, v2
sub-int/2addr p2, v3
if-nez p1, :cond_0
if-nez p2, :cond_0
iget-object p1, p0, Landroidx/customview/widget/ViewDragHelper;->mScroller:Landroid/widget/OverScroller;
invoke-virtual {p1}, Landroid/widget/OverScroller;->abortAnimation()V
const/4 p1, 0x0
invoke-virtual {p0, p1}, Landroidx/customview/widget/ViewDragHelper;->setDragState(I)V
return p1
:cond_0
iget-object v5, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
move-object v4, p0
move v6, p1
move v7, p2
move v8, p3
move v9, p4
invoke-direct/range {v4 .. v9}, Landroidx/customview/widget/ViewDragHelper;->computeSettleDuration(Landroid/view/View;IIII)I
move-result v6
iget-object v1, p0, Landroidx/customview/widget/ViewDragHelper;->mScroller:Landroid/widget/OverScroller;
move v4, p1
move v5, p2
invoke-virtual/range {v1 .. v6}, Landroid/widget/OverScroller;->startScroll(IIIII)V
const/4 p1, 0x2
invoke-virtual {p0, p1}, Landroidx/customview/widget/ViewDragHelper;->setDragState(I)V
const/4 p1, 0x1
return p1
.end method
.method private getEdgesTouched(II)I
.locals 3
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mParentView:Landroid/view/ViewGroup;
invoke-virtual {v0}, Landroid/view/ViewGroup;->getLeft()I
move-result v0
iget v1, p0, Landroidx/customview/widget/ViewDragHelper;->mEdgeSize:I
add-int/2addr v0, v1
if-ge p1, v0, :cond_0
const/4 v0, 0x1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
iget-object v1, p0, Landroidx/customview/widget/ViewDragHelper;->mParentView:Landroid/view/ViewGroup;
invoke-virtual {v1}, Landroid/view/ViewGroup;->getTop()I
move-result v1
iget v2, p0, Landroidx/customview/widget/ViewDragHelper;->mEdgeSize:I
add-int/2addr v1, v2
if-ge p2, v1, :cond_1
or-int/lit8 v0, v0, 0x4
:cond_1
iget-object v1, p0, Landroidx/customview/widget/ViewDragHelper;->mParentView:Landroid/view/ViewGroup;
invoke-virtual {v1}, Landroid/view/ViewGroup;->getRight()I
move-result v1
iget v2, p0, Landroidx/customview/widget/ViewDragHelper;->mEdgeSize:I
sub-int/2addr v1, v2
if-le p1, v1, :cond_2
or-int/lit8 v0, v0, 0x2
:cond_2
iget-object p1, p0, Landroidx/customview/widget/ViewDragHelper;->mParentView:Landroid/view/ViewGroup;
invoke-virtual {p1}, Landroid/view/ViewGroup;->getBottom()I
move-result p1
iget v1, p0, Landroidx/customview/widget/ViewDragHelper;->mEdgeSize:I
sub-int/2addr p1, v1
if-le p2, p1, :cond_3
or-int/lit8 v0, v0, 0x8
:cond_3
return v0
.end method
.method private isValidPointerForActionMove(I)Z
.locals 3
invoke-virtual {p0, p1}, Landroidx/customview/widget/ViewDragHelper;->isPointerDown(I)Z
move-result v0
if-nez v0, :cond_0
const-string v0, "ViewDragHelper"
new-instance v1, Ljava/lang/StringBuilder;
const-string v2, "Ignoring pointerId="
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
const-string p1, " because ACTION_DOWN was not received for this pointer before ACTION_MOVE. It likely happened because ViewDragHelper did not receive all the events in the event stream."
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
invoke-static {v0, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
const/4 p1, 0x0
return p1
:cond_0
const/4 p1, 0x1
return p1
.end method
.method private releaseViewForPointerUp()V
.locals 4
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mVelocityTracker:Landroid/view/VelocityTracker;
iget v1, p0, Landroidx/customview/widget/ViewDragHelper;->mMaxVelocity:F
const/16 v2, 0x3e8
invoke-virtual {v0, v2, v1}, Landroid/view/VelocityTracker;->computeCurrentVelocity(IF)V
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mVelocityTracker:Landroid/view/VelocityTracker;
iget v1, p0, Landroidx/customview/widget/ViewDragHelper;->mActivePointerId:I
invoke-virtual {v0, v1}, Landroid/view/VelocityTracker;->getXVelocity(I)F
move-result v0
iget v1, p0, Landroidx/customview/widget/ViewDragHelper;->mMinVelocity:F
iget v2, p0, Landroidx/customview/widget/ViewDragHelper;->mMaxVelocity:F
invoke-direct {p0, v0, v1, v2}, Landroidx/customview/widget/ViewDragHelper;->clampMag(FFF)F
move-result v0
iget-object v1, p0, Landroidx/customview/widget/ViewDragHelper;->mVelocityTracker:Landroid/view/VelocityTracker;
iget v2, p0, Landroidx/customview/widget/ViewDragHelper;->mActivePointerId:I
invoke-virtual {v1, v2}, Landroid/view/VelocityTracker;->getYVelocity(I)F
move-result v1
iget v2, p0, Landroidx/customview/widget/ViewDragHelper;->mMinVelocity:F
iget v3, p0, Landroidx/customview/widget/ViewDragHelper;->mMaxVelocity:F
invoke-direct {p0, v1, v2, v3}, Landroidx/customview/widget/ViewDragHelper;->clampMag(FFF)F
move-result v1
invoke-direct {p0, v0, v1}, Landroidx/customview/widget/ViewDragHelper;->dispatchViewReleased(FF)V
return-void
.end method
.method private reportNewEdgeDrags(FFI)V
.locals 2
const/4 v0, 0x1
invoke-direct {p0, p1, p2, p3, v0}, Landroidx/customview/widget/ViewDragHelper;->checkNewEdgeDrag(FFII)Z
move-result v0
const/4 v1, 0x4
invoke-direct {p0, p2, p1, p3, v1}, Landroidx/customview/widget/ViewDragHelper;->checkNewEdgeDrag(FFII)Z
move-result v1
if-eqz v1, :cond_0
or-int/lit8 v0, v0, 0x4
:cond_0
const/4 v1, 0x2
invoke-direct {p0, p1, p2, p3, v1}, Landroidx/customview/widget/ViewDragHelper;->checkNewEdgeDrag(FFII)Z
move-result v1
if-eqz v1, :cond_1
or-int/lit8 v0, v0, 0x2
:cond_1
const/16 v1, 0x8
invoke-direct {p0, p2, p1, p3, v1}, Landroidx/customview/widget/ViewDragHelper;->checkNewEdgeDrag(FFII)Z
move-result p1
if-eqz p1, :cond_2
or-int/lit8 v0, v0, 0x8
:cond_2
if-eqz v0, :cond_3
iget-object p1, p0, Landroidx/customview/widget/ViewDragHelper;->mEdgeDragsInProgress:[I
aget p2, p1, p3
or-int/2addr p2, v0
aput p2, p1, p3
iget-object p1, p0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
invoke-virtual {p1, v0, p3}, Landroidx/customview/widget/ViewDragHelper$Callback;->onEdgeDragStarted(II)V
:cond_3
return-void
.end method
.method private saveInitialMotion(FFI)V
.locals 2
invoke-direct {p0, p3}, Landroidx/customview/widget/ViewDragHelper;->ensureMotionHistorySizeForId(I)V
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionX:[F
iget-object v1, p0, Landroidx/customview/widget/ViewDragHelper;->mLastMotionX:[F
aput p1, v1, p3
aput p1, v0, p3
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionY:[F
iget-object v1, p0, Landroidx/customview/widget/ViewDragHelper;->mLastMotionY:[F
aput p2, v1, p3
aput p2, v0, p3
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialEdgesTouched:[I
float-to-int p1, p1
float-to-int p2, p2
invoke-direct {p0, p1, p2}, Landroidx/customview/widget/ViewDragHelper;->getEdgesTouched(II)I
move-result p1
aput p1, v0, p3
iget p1, p0, Landroidx/customview/widget/ViewDragHelper;->mPointersDown:I
const/4 p2, 0x1
shl-int/2addr p2, p3
or-int/2addr p1, p2
iput p1, p0, Landroidx/customview/widget/ViewDragHelper;->mPointersDown:I
return-void
.end method
.method private saveLastMotion(Landroid/view/MotionEvent;)V
.locals 6
invoke-virtual {p1}, Landroid/view/MotionEvent;->getPointerCount()I
move-result v0
const/4 v1, 0x0
:goto_0
if-ge v1, v0, :cond_1
invoke-virtual {p1, v1}, Landroid/view/MotionEvent;->getPointerId(I)I
move-result v2
invoke-direct {p0, v2}, Landroidx/customview/widget/ViewDragHelper;->isValidPointerForActionMove(I)Z
move-result v3
if-eqz v3, :cond_0
invoke-virtual {p1, v1}, Landroid/view/MotionEvent;->getX(I)F
move-result v3
invoke-virtual {p1, v1}, Landroid/view/MotionEvent;->getY(I)F
move-result v4
iget-object v5, p0, Landroidx/customview/widget/ViewDragHelper;->mLastMotionX:[F
aput v3, v5, v2
iget-object v3, p0, Landroidx/customview/widget/ViewDragHelper;->mLastMotionY:[F
aput v4, v3, v2
:cond_0
add-int/lit8 v1, v1, 0x1
goto :goto_0
:cond_1
return-void
.end method
# virtual methods
.method public abort()V
.locals 9
invoke-virtual {p0}, Landroidx/customview/widget/ViewDragHelper;->cancel()V
iget v0, p0, Landroidx/customview/widget/ViewDragHelper;->mDragState:I
const/4 v1, 0x2
if-ne v0, v1, :cond_0
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mScroller:Landroid/widget/OverScroller;
invoke-virtual {v0}, Landroid/widget/OverScroller;->getCurrX()I
move-result v0
iget-object v1, p0, Landroidx/customview/widget/ViewDragHelper;->mScroller:Landroid/widget/OverScroller;
invoke-virtual {v1}, Landroid/widget/OverScroller;->getCurrY()I
move-result v1
iget-object v2, p0, Landroidx/customview/widget/ViewDragHelper;->mScroller:Landroid/widget/OverScroller;
invoke-virtual {v2}, Landroid/widget/OverScroller;->abortAnimation()V
iget-object v2, p0, Landroidx/customview/widget/ViewDragHelper;->mScroller:Landroid/widget/OverScroller;
invoke-virtual {v2}, Landroid/widget/OverScroller;->getCurrX()I
move-result v5
iget-object v2, p0, Landroidx/customview/widget/ViewDragHelper;->mScroller:Landroid/widget/OverScroller;
invoke-virtual {v2}, Landroid/widget/OverScroller;->getCurrY()I
move-result v6
iget-object v3, p0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
iget-object v4, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
sub-int v7, v5, v0
sub-int v8, v6, v1
invoke-virtual/range {v3 .. v8}, Landroidx/customview/widget/ViewDragHelper$Callback;->onViewPositionChanged(Landroid/view/View;IIII)V
:cond_0
const/4 v0, 0x0
invoke-virtual {p0, v0}, Landroidx/customview/widget/ViewDragHelper;->setDragState(I)V
return-void
.end method
.method protected canScroll(Landroid/view/View;ZIIII)Z
.locals 13
.param p1 # Landroid/view/View;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
move-object v0, p1
instance-of v1, v0, Landroid/view/ViewGroup;
const/4 v2, 0x1
if-eqz v1, :cond_1
move-object v1, v0
check-cast v1, Landroid/view/ViewGroup;
invoke-virtual {p1}, Landroid/view/View;->getScrollX()I
move-result v3
invoke-virtual {p1}, Landroid/view/View;->getScrollY()I
move-result v4
invoke-virtual {v1}, Landroid/view/ViewGroup;->getChildCount()I
move-result v5
sub-int/2addr v5, v2
:goto_0
if-ltz v5, :cond_1
invoke-virtual {v1, v5}, Landroid/view/ViewGroup;->getChildAt(I)Landroid/view/View;
move-result-object v7
add-int v6, p5, v3
invoke-virtual {v7}, Landroid/view/View;->getLeft()I
move-result v8
if-lt v6, v8, :cond_0
invoke-virtual {v7}, Landroid/view/View;->getRight()I
move-result v8
if-ge v6, v8, :cond_0
add-int v8, p6, v4
invoke-virtual {v7}, Landroid/view/View;->getTop()I
move-result v9
if-lt v8, v9, :cond_0
invoke-virtual {v7}, Landroid/view/View;->getBottom()I
move-result v9
if-ge v8, v9, :cond_0
const/4 v9, 0x1
invoke-virtual {v7}, Landroid/view/View;->getLeft()I
move-result v10
sub-int v11, v6, v10
invoke-virtual {v7}, Landroid/view/View;->getTop()I
move-result v6
sub-int v12, v8, v6
move-object v6, p0
move v8, v9
move/from16 v9, p3
move/from16 v10, p4
invoke-virtual/range {v6 .. v12}, Landroidx/customview/widget/ViewDragHelper;->canScroll(Landroid/view/View;ZIIII)Z
move-result v6
if-eqz v6, :cond_0
return v2
:cond_0
add-int/lit8 v5, v5, -0x1
goto :goto_0
:cond_1
if-eqz p2, :cond_3
move/from16 v1, p3
neg-int v1, v1
invoke-virtual {p1, v1}, Landroid/view/View;->canScrollHorizontally(I)Z
move-result v1
if-nez v1, :cond_2
move/from16 v1, p4
neg-int v1, v1
invoke-virtual {p1, v1}, Landroid/view/View;->canScrollVertically(I)Z
move-result v0
if-eqz v0, :cond_3
:cond_2
return v2
:cond_3
const/4 v0, 0x0
return v0
.end method
.method public cancel()V
.locals 1
const/4 v0, -0x1
iput v0, p0, Landroidx/customview/widget/ViewDragHelper;->mActivePointerId:I
invoke-direct {p0}, Landroidx/customview/widget/ViewDragHelper;->clearMotionHistory()V
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mVelocityTracker:Landroid/view/VelocityTracker;
if-eqz v0, :cond_0
invoke-virtual {v0}, Landroid/view/VelocityTracker;->recycle()V
const/4 v0, 0x0
iput-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mVelocityTracker:Landroid/view/VelocityTracker;
:cond_0
return-void
.end method
.method public captureChildView(Landroid/view/View;I)V
.locals 2
.param p1 # Landroid/view/View;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
invoke-virtual {p1}, Landroid/view/View;->getParent()Landroid/view/ViewParent;
move-result-object v0
iget-object v1, p0, Landroidx/customview/widget/ViewDragHelper;->mParentView:Landroid/view/ViewGroup;
if-ne v0, v1, :cond_0
iput-object p1, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
iput p2, p0, Landroidx/customview/widget/ViewDragHelper;->mActivePointerId:I
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
invoke-virtual {v0, p1, p2}, Landroidx/customview/widget/ViewDragHelper$Callback;->onViewCaptured(Landroid/view/View;I)V
const/4 p1, 0x1
invoke-virtual {p0, p1}, Landroidx/customview/widget/ViewDragHelper;->setDragState(I)V
return-void
:cond_0
new-instance p1, Ljava/lang/IllegalArgumentException;
new-instance p2, Ljava/lang/StringBuilder;
const-string v0, "captureChildView: parameter must be a descendant of the ViewDragHelper\'s tracked parent view ("
invoke-direct {p2, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mParentView:Landroid/view/ViewGroup;
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string v0, ")"
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p2
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public checkTouchSlop(I)Z
.locals 4
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionX:[F
array-length v0, v0
const/4 v1, 0x0
const/4 v2, 0x0
:goto_0
if-ge v2, v0, :cond_1
invoke-virtual {p0, p1, v2}, Landroidx/customview/widget/ViewDragHelper;->checkTouchSlop(II)Z
move-result v3
if-eqz v3, :cond_0
const/4 p1, 0x1
return p1
:cond_0
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_1
return v1
.end method
.method public checkTouchSlop(II)Z
.locals 6
invoke-virtual {p0, p2}, Landroidx/customview/widget/ViewDragHelper;->isPointerDown(I)Z
move-result v0
const/4 v1, 0x0
if-nez v0, :cond_0
return v1
:cond_0
and-int/lit8 v0, p1, 0x1
const/4 v2, 0x1
if-ne v0, v2, :cond_1
const/4 v0, 0x1
goto :goto_0
:cond_1
const/4 v0, 0x0
:goto_0
const/4 v3, 0x2
and-int/2addr p1, v3
if-ne p1, v3, :cond_2
const/4 p1, 0x1
goto :goto_1
:cond_2
const/4 p1, 0x0
:goto_1
iget-object v3, p0, Landroidx/customview/widget/ViewDragHelper;->mLastMotionX:[F
aget v3, v3, p2
iget-object v4, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionX:[F
aget v4, v4, p2
sub-float/2addr v3, v4
iget-object v4, p0, Landroidx/customview/widget/ViewDragHelper;->mLastMotionY:[F
aget v4, v4, p2
iget-object v5, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionY:[F
aget p2, v5, p2
sub-float/2addr v4, p2
if-eqz v0, :cond_4
if-eqz p1, :cond_4
mul-float v3, v3, v3
mul-float v4, v4, v4
add-float/2addr v3, v4
iget p1, p0, Landroidx/customview/widget/ViewDragHelper;->mTouchSlop:I
2019-02-04 20:29:01 +00:00
mul-int p1, p1, p1
2019-02-04 20:08:30 +00:00
int-to-float p1, p1
cmpl-float p1, v3, p1
if-lez p1, :cond_3
return v2
:cond_3
return v1
:cond_4
if-eqz v0, :cond_6
invoke-static {v3}, Ljava/lang/Math;->abs(F)F
move-result p1
iget p2, p0, Landroidx/customview/widget/ViewDragHelper;->mTouchSlop:I
int-to-float p2, p2
cmpl-float p1, p1, p2
if-lez p1, :cond_5
return v2
:cond_5
return v1
:cond_6
2019-02-04 20:29:01 +00:00
if-eqz p1, :cond_8
2019-02-04 20:08:30 +00:00
invoke-static {v4}, Ljava/lang/Math;->abs(F)F
move-result p1
iget p2, p0, Landroidx/customview/widget/ViewDragHelper;->mTouchSlop:I
int-to-float p2, p2
cmpl-float p1, p1, p2
if-lez p1, :cond_7
return v2
:cond_7
return v1
2019-02-04 20:29:01 +00:00
:cond_8
return v1
2019-02-04 20:08:30 +00:00
.end method
.method public continueSettling(Z)Z
.locals 11
iget v0, p0, Landroidx/customview/widget/ViewDragHelper;->mDragState:I
const/4 v1, 0x2
const/4 v2, 0x0
if-ne v0, v1, :cond_6
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mScroller:Landroid/widget/OverScroller;
invoke-virtual {v0}, Landroid/widget/OverScroller;->computeScrollOffset()Z
move-result v0
iget-object v3, p0, Landroidx/customview/widget/ViewDragHelper;->mScroller:Landroid/widget/OverScroller;
invoke-virtual {v3}, Landroid/widget/OverScroller;->getCurrX()I
move-result v3
iget-object v4, p0, Landroidx/customview/widget/ViewDragHelper;->mScroller:Landroid/widget/OverScroller;
invoke-virtual {v4}, Landroid/widget/OverScroller;->getCurrY()I
move-result v10
iget-object v4, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
invoke-virtual {v4}, Landroid/view/View;->getLeft()I
move-result v4
sub-int v8, v3, v4
iget-object v4, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
invoke-virtual {v4}, Landroid/view/View;->getTop()I
move-result v4
sub-int v9, v10, v4
if-eqz v8, :cond_0
iget-object v4, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
invoke-static {v4, v8}, Landroidx/core/view/ViewCompat;->offsetLeftAndRight(Landroid/view/View;I)V
:cond_0
if-eqz v9, :cond_1
iget-object v4, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
invoke-static {v4, v9}, Landroidx/core/view/ViewCompat;->offsetTopAndBottom(Landroid/view/View;I)V
:cond_1
if-nez v8, :cond_2
if-eqz v9, :cond_3
:cond_2
iget-object v4, p0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
iget-object v5, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
move v6, v3
move v7, v10
invoke-virtual/range {v4 .. v9}, Landroidx/customview/widget/ViewDragHelper$Callback;->onViewPositionChanged(Landroid/view/View;IIII)V
:cond_3
if-eqz v0, :cond_4
iget-object v4, p0, Landroidx/customview/widget/ViewDragHelper;->mScroller:Landroid/widget/OverScroller;
invoke-virtual {v4}, Landroid/widget/OverScroller;->getFinalX()I
move-result v4
if-ne v3, v4, :cond_4
iget-object v3, p0, Landroidx/customview/widget/ViewDragHelper;->mScroller:Landroid/widget/OverScroller;
invoke-virtual {v3}, Landroid/widget/OverScroller;->getFinalY()I
move-result v3
if-ne v10, v3, :cond_4
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mScroller:Landroid/widget/OverScroller;
invoke-virtual {v0}, Landroid/widget/OverScroller;->abortAnimation()V
const/4 v0, 0x0
:cond_4
if-nez v0, :cond_6
if-eqz p1, :cond_5
iget-object p1, p0, Landroidx/customview/widget/ViewDragHelper;->mParentView:Landroid/view/ViewGroup;
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mSetIdleRunnable:Ljava/lang/Runnable;
invoke-virtual {p1, v0}, Landroid/view/ViewGroup;->post(Ljava/lang/Runnable;)Z
goto :goto_0
:cond_5
invoke-virtual {p0, v2}, Landroidx/customview/widget/ViewDragHelper;->setDragState(I)V
:cond_6
:goto_0
iget p1, p0, Landroidx/customview/widget/ViewDragHelper;->mDragState:I
if-ne p1, v1, :cond_7
const/4 p1, 0x1
return p1
:cond_7
return v2
.end method
.method public findTopChildUnder(II)Landroid/view/View;
.locals 3
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mParentView:Landroid/view/ViewGroup;
invoke-virtual {v0}, Landroid/view/ViewGroup;->getChildCount()I
move-result v0
add-int/lit8 v0, v0, -0x1
:goto_0
if-ltz v0, :cond_1
iget-object v1, p0, Landroidx/customview/widget/ViewDragHelper;->mParentView:Landroid/view/ViewGroup;
iget-object v2, p0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
invoke-virtual {v2, v0}, Landroidx/customview/widget/ViewDragHelper$Callback;->getOrderedChildIndex(I)I
move-result v2
invoke-virtual {v1, v2}, Landroid/view/ViewGroup;->getChildAt(I)Landroid/view/View;
move-result-object v1
invoke-virtual {v1}, Landroid/view/View;->getLeft()I
move-result v2
if-lt p1, v2, :cond_0
invoke-virtual {v1}, Landroid/view/View;->getRight()I
move-result v2
if-ge p1, v2, :cond_0
invoke-virtual {v1}, Landroid/view/View;->getTop()I
move-result v2
if-lt p2, v2, :cond_0
invoke-virtual {v1}, Landroid/view/View;->getBottom()I
move-result v2
if-ge p2, v2, :cond_0
return-object v1
:cond_0
add-int/lit8 v0, v0, -0x1
goto :goto_0
:cond_1
const/4 p1, 0x0
return-object p1
.end method
.method public flingCapturedView(IIII)V
.locals 10
iget-boolean v0, p0, Landroidx/customview/widget/ViewDragHelper;->mReleaseInProgress:Z
if-eqz v0, :cond_0
iget-object v1, p0, Landroidx/customview/widget/ViewDragHelper;->mScroller:Landroid/widget/OverScroller;
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
invoke-virtual {v0}, Landroid/view/View;->getLeft()I
move-result v2
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
invoke-virtual {v0}, Landroid/view/View;->getTop()I
move-result v3
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mVelocityTracker:Landroid/view/VelocityTracker;
iget v4, p0, Landroidx/customview/widget/ViewDragHelper;->mActivePointerId:I
invoke-virtual {v0, v4}, Landroid/view/VelocityTracker;->getXVelocity(I)F
move-result v0
float-to-int v4, v0
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mVelocityTracker:Landroid/view/VelocityTracker;
iget v5, p0, Landroidx/customview/widget/ViewDragHelper;->mActivePointerId:I
invoke-virtual {v0, v5}, Landroid/view/VelocityTracker;->getYVelocity(I)F
move-result v0
float-to-int v5, v0
move v6, p1
move v7, p3
move v8, p2
move v9, p4
invoke-virtual/range {v1 .. v9}, Landroid/widget/OverScroller;->fling(IIIIIIII)V
const/4 p1, 0x2
invoke-virtual {p0, p1}, Landroidx/customview/widget/ViewDragHelper;->setDragState(I)V
return-void
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
const-string p2, "Cannot flingCapturedView outside of a call to Callback#onViewReleased"
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public getActivePointerId()I
.locals 1
iget v0, p0, Landroidx/customview/widget/ViewDragHelper;->mActivePointerId:I
return v0
.end method
.method public getCapturedView()Landroid/view/View;
.locals 1
.annotation build Landroidx/annotation/Nullable;
.end annotation
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
return-object v0
.end method
.method public getEdgeSize()I
.locals 1
.annotation build Landroidx/annotation/Px;
.end annotation
iget v0, p0, Landroidx/customview/widget/ViewDragHelper;->mEdgeSize:I
return v0
.end method
.method public getMinVelocity()F
.locals 1
iget v0, p0, Landroidx/customview/widget/ViewDragHelper;->mMinVelocity:F
return v0
.end method
.method public getTouchSlop()I
.locals 1
.annotation build Landroidx/annotation/Px;
.end annotation
iget v0, p0, Landroidx/customview/widget/ViewDragHelper;->mTouchSlop:I
return v0
.end method
.method public getViewDragState()I
.locals 1
iget v0, p0, Landroidx/customview/widget/ViewDragHelper;->mDragState:I
return v0
.end method
.method public isCapturedViewUnder(II)Z
.locals 1
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
invoke-virtual {p0, v0, p1, p2}, Landroidx/customview/widget/ViewDragHelper;->isViewUnder(Landroid/view/View;II)Z
move-result p1
return p1
.end method
.method public isEdgeTouched(I)Z
.locals 4
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialEdgesTouched:[I
array-length v0, v0
const/4 v1, 0x0
const/4 v2, 0x0
:goto_0
if-ge v2, v0, :cond_1
invoke-virtual {p0, p1, v2}, Landroidx/customview/widget/ViewDragHelper;->isEdgeTouched(II)Z
move-result v3
if-eqz v3, :cond_0
const/4 p1, 0x1
return p1
:cond_0
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_1
return v1
.end method
.method public isEdgeTouched(II)Z
.locals 1
invoke-virtual {p0, p2}, Landroidx/customview/widget/ViewDragHelper;->isPointerDown(I)Z
move-result v0
if-eqz v0, :cond_0
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialEdgesTouched:[I
aget p2, v0, p2
and-int/2addr p1, p2
if-eqz p1, :cond_0
const/4 p1, 0x1
return p1
:cond_0
const/4 p1, 0x0
return p1
.end method
.method public isPointerDown(I)Z
.locals 2
iget v0, p0, Landroidx/customview/widget/ViewDragHelper;->mPointersDown:I
const/4 v1, 0x1
shl-int p1, v1, p1
and-int/2addr p1, v0
if-eqz p1, :cond_0
return v1
:cond_0
const/4 p1, 0x0
return p1
.end method
.method public isViewUnder(Landroid/view/View;II)Z
.locals 2
.param p1 # Landroid/view/View;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end param
const/4 v0, 0x0
if-nez p1, :cond_0
return v0
:cond_0
invoke-virtual {p1}, Landroid/view/View;->getLeft()I
move-result v1
if-lt p2, v1, :cond_1
invoke-virtual {p1}, Landroid/view/View;->getRight()I
move-result v1
if-ge p2, v1, :cond_1
invoke-virtual {p1}, Landroid/view/View;->getTop()I
move-result p2
if-lt p3, p2, :cond_1
invoke-virtual {p1}, Landroid/view/View;->getBottom()I
move-result p1
if-ge p3, p1, :cond_1
const/4 p1, 0x1
return p1
:cond_1
return v0
.end method
.method public processTouchEvent(Landroid/view/MotionEvent;)V
.locals 9
.param p1 # Landroid/view/MotionEvent;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
invoke-virtual {p1}, Landroid/view/MotionEvent;->getActionMasked()I
move-result v0
invoke-virtual {p1}, Landroid/view/MotionEvent;->getActionIndex()I
move-result v1
if-nez v0, :cond_0
invoke-virtual {p0}, Landroidx/customview/widget/ViewDragHelper;->cancel()V
:cond_0
iget-object v2, p0, Landroidx/customview/widget/ViewDragHelper;->mVelocityTracker:Landroid/view/VelocityTracker;
if-nez v2, :cond_1
invoke-static {}, Landroid/view/VelocityTracker;->obtain()Landroid/view/VelocityTracker;
move-result-object v2
iput-object v2, p0, Landroidx/customview/widget/ViewDragHelper;->mVelocityTracker:Landroid/view/VelocityTracker;
:cond_1
iget-object v2, p0, Landroidx/customview/widget/ViewDragHelper;->mVelocityTracker:Landroid/view/VelocityTracker;
invoke-virtual {v2, p1}, Landroid/view/VelocityTracker;->addMovement(Landroid/view/MotionEvent;)V
const/4 v2, 0x0
const/4 v3, 0x1
packed-switch v0, :pswitch_data_0
:pswitch_0
goto/16 :goto_3
:pswitch_1
invoke-virtual {p1, v1}, Landroid/view/MotionEvent;->getPointerId(I)I
move-result v0
iget v1, p0, Landroidx/customview/widget/ViewDragHelper;->mDragState:I
if-ne v1, v3, :cond_4
iget v1, p0, Landroidx/customview/widget/ViewDragHelper;->mActivePointerId:I
if-ne v0, v1, :cond_4
invoke-virtual {p1}, Landroid/view/MotionEvent;->getPointerCount()I
move-result v1
:goto_0
const/4 v3, -0x1
if-ge v2, v1, :cond_3
invoke-virtual {p1, v2}, Landroid/view/MotionEvent;->getPointerId(I)I
move-result v4
iget v5, p0, Landroidx/customview/widget/ViewDragHelper;->mActivePointerId:I
if-eq v4, v5, :cond_2
invoke-virtual {p1, v2}, Landroid/view/MotionEvent;->getX(I)F
move-result v5
invoke-virtual {p1, v2}, Landroid/view/MotionEvent;->getY(I)F
move-result v6
float-to-int v5, v5
float-to-int v6, v6
invoke-virtual {p0, v5, v6}, Landroidx/customview/widget/ViewDragHelper;->findTopChildUnder(II)Landroid/view/View;
move-result-object v5
iget-object v6, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
if-ne v5, v6, :cond_2
2019-02-04 20:29:01 +00:00
invoke-virtual {p0, v6, v4}, Landroidx/customview/widget/ViewDragHelper;->tryCaptureViewForDrag(Landroid/view/View;I)Z
2019-02-04 20:08:30 +00:00
move-result v4
if-eqz v4, :cond_2
iget p1, p0, Landroidx/customview/widget/ViewDragHelper;->mActivePointerId:I
goto :goto_1
:cond_2
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_3
const/4 p1, -0x1
:goto_1
if-ne p1, v3, :cond_4
invoke-direct {p0}, Landroidx/customview/widget/ViewDragHelper;->releaseViewForPointerUp()V
:cond_4
invoke-direct {p0, v0}, Landroidx/customview/widget/ViewDragHelper;->clearMotionHistory(I)V
return-void
:pswitch_2
invoke-virtual {p1, v1}, Landroid/view/MotionEvent;->getPointerId(I)I
move-result v0
invoke-virtual {p1, v1}, Landroid/view/MotionEvent;->getX(I)F
move-result v2
invoke-virtual {p1, v1}, Landroid/view/MotionEvent;->getY(I)F
move-result p1
invoke-direct {p0, v2, p1, v0}, Landroidx/customview/widget/ViewDragHelper;->saveInitialMotion(FFI)V
iget v1, p0, Landroidx/customview/widget/ViewDragHelper;->mDragState:I
if-nez v1, :cond_6
float-to-int v1, v2
float-to-int p1, p1
invoke-virtual {p0, v1, p1}, Landroidx/customview/widget/ViewDragHelper;->findTopChildUnder(II)Landroid/view/View;
move-result-object p1
invoke-virtual {p0, p1, v0}, Landroidx/customview/widget/ViewDragHelper;->tryCaptureViewForDrag(Landroid/view/View;I)Z
iget-object p1, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialEdgesTouched:[I
aget p1, p1, v0
iget v1, p0, Landroidx/customview/widget/ViewDragHelper;->mTrackingEdges:I
2019-02-04 20:29:01 +00:00
and-int v2, p1, v1
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
if-eqz v2, :cond_5
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
iget-object v2, p0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
and-int/2addr p1, v1
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
invoke-virtual {v2, p1, v0}, Landroidx/customview/widget/ViewDragHelper$Callback;->onEdgeTouched(II)V
2019-02-04 20:08:30 +00:00
:cond_5
return-void
:cond_6
float-to-int v1, v2
float-to-int p1, p1
invoke-virtual {p0, v1, p1}, Landroidx/customview/widget/ViewDragHelper;->isCapturedViewUnder(II)Z
move-result p1
if-eqz p1, :cond_c
iget-object p1, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
invoke-virtual {p0, p1, v0}, Landroidx/customview/widget/ViewDragHelper;->tryCaptureViewForDrag(Landroid/view/View;I)Z
return-void
:pswitch_3
iget p1, p0, Landroidx/customview/widget/ViewDragHelper;->mDragState:I
if-ne p1, v3, :cond_7
const/4 p1, 0x0
invoke-direct {p0, p1, p1}, Landroidx/customview/widget/ViewDragHelper;->dispatchViewReleased(FF)V
:cond_7
invoke-virtual {p0}, Landroidx/customview/widget/ViewDragHelper;->cancel()V
goto/16 :goto_3
:pswitch_4
iget v0, p0, Landroidx/customview/widget/ViewDragHelper;->mDragState:I
if-ne v0, v3, :cond_8
iget v0, p0, Landroidx/customview/widget/ViewDragHelper;->mActivePointerId:I
invoke-direct {p0, v0}, Landroidx/customview/widget/ViewDragHelper;->isValidPointerForActionMove(I)Z
move-result v0
if-eqz v0, :cond_c
iget v0, p0, Landroidx/customview/widget/ViewDragHelper;->mActivePointerId:I
invoke-virtual {p1, v0}, Landroid/view/MotionEvent;->findPointerIndex(I)I
move-result v0
invoke-virtual {p1, v0}, Landroid/view/MotionEvent;->getX(I)F
move-result v1
invoke-virtual {p1, v0}, Landroid/view/MotionEvent;->getY(I)F
move-result v0
iget-object v2, p0, Landroidx/customview/widget/ViewDragHelper;->mLastMotionX:[F
iget v3, p0, Landroidx/customview/widget/ViewDragHelper;->mActivePointerId:I
aget v2, v2, v3
sub-float/2addr v1, v2
float-to-int v1, v1
iget-object v2, p0, Landroidx/customview/widget/ViewDragHelper;->mLastMotionY:[F
aget v2, v2, v3
sub-float/2addr v0, v2
float-to-int v0, v0
iget-object v2, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
invoke-virtual {v2}, Landroid/view/View;->getLeft()I
move-result v2
add-int/2addr v2, v1
iget-object v3, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
invoke-virtual {v3}, Landroid/view/View;->getTop()I
move-result v3
add-int/2addr v3, v0
invoke-direct {p0, v2, v3, v1, v0}, Landroidx/customview/widget/ViewDragHelper;->dragTo(IIII)V
invoke-direct {p0, p1}, Landroidx/customview/widget/ViewDragHelper;->saveLastMotion(Landroid/view/MotionEvent;)V
return-void
:cond_8
invoke-virtual {p1}, Landroid/view/MotionEvent;->getPointerCount()I
move-result v0
:goto_2
if-ge v2, v0, :cond_a
invoke-virtual {p1, v2}, Landroid/view/MotionEvent;->getPointerId(I)I
move-result v1
invoke-direct {p0, v1}, Landroidx/customview/widget/ViewDragHelper;->isValidPointerForActionMove(I)Z
move-result v4
if-eqz v4, :cond_9
invoke-virtual {p1, v2}, Landroid/view/MotionEvent;->getX(I)F
move-result v4
invoke-virtual {p1, v2}, Landroid/view/MotionEvent;->getY(I)F
move-result v5
iget-object v6, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionX:[F
aget v6, v6, v1
sub-float v6, v4, v6
iget-object v7, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionY:[F
aget v7, v7, v1
sub-float v7, v5, v7
invoke-direct {p0, v6, v7, v1}, Landroidx/customview/widget/ViewDragHelper;->reportNewEdgeDrags(FFI)V
iget v8, p0, Landroidx/customview/widget/ViewDragHelper;->mDragState:I
if-eq v8, v3, :cond_a
float-to-int v4, v4
float-to-int v5, v5
invoke-virtual {p0, v4, v5}, Landroidx/customview/widget/ViewDragHelper;->findTopChildUnder(II)Landroid/view/View;
move-result-object v4
invoke-direct {p0, v4, v6, v7}, Landroidx/customview/widget/ViewDragHelper;->checkTouchSlop(Landroid/view/View;FF)Z
move-result v5
if-eqz v5, :cond_9
invoke-virtual {p0, v4, v1}, Landroidx/customview/widget/ViewDragHelper;->tryCaptureViewForDrag(Landroid/view/View;I)Z
move-result v1
if-nez v1, :cond_a
:cond_9
add-int/lit8 v2, v2, 0x1
goto :goto_2
:cond_a
invoke-direct {p0, p1}, Landroidx/customview/widget/ViewDragHelper;->saveLastMotion(Landroid/view/MotionEvent;)V
return-void
:pswitch_5
iget p1, p0, Landroidx/customview/widget/ViewDragHelper;->mDragState:I
if-ne p1, v3, :cond_b
invoke-direct {p0}, Landroidx/customview/widget/ViewDragHelper;->releaseViewForPointerUp()V
:cond_b
invoke-virtual {p0}, Landroidx/customview/widget/ViewDragHelper;->cancel()V
return-void
:pswitch_6
invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F
move-result v0
invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F
move-result v1
invoke-virtual {p1, v2}, Landroid/view/MotionEvent;->getPointerId(I)I
move-result p1
float-to-int v2, v0
float-to-int v3, v1
invoke-virtual {p0, v2, v3}, Landroidx/customview/widget/ViewDragHelper;->findTopChildUnder(II)Landroid/view/View;
move-result-object v2
invoke-direct {p0, v0, v1, p1}, Landroidx/customview/widget/ViewDragHelper;->saveInitialMotion(FFI)V
invoke-virtual {p0, v2, p1}, Landroidx/customview/widget/ViewDragHelper;->tryCaptureViewForDrag(Landroid/view/View;I)Z
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mInitialEdgesTouched:[I
aget v0, v0, p1
iget v1, p0, Landroidx/customview/widget/ViewDragHelper;->mTrackingEdges:I
2019-02-04 20:29:01 +00:00
and-int v2, v0, v1
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
if-eqz v2, :cond_c
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
iget-object v2, p0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
and-int/2addr v0, v1
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
invoke-virtual {v2, v0, p1}, Landroidx/customview/widget/ViewDragHelper$Callback;->onEdgeTouched(II)V
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
return-void
2019-02-04 20:08:30 +00:00
:cond_c
:goto_3
return-void
:pswitch_data_0
.packed-switch 0x0
:pswitch_6
:pswitch_5
:pswitch_4
:pswitch_3
:pswitch_0
:pswitch_2
:pswitch_1
.end packed-switch
.end method
.method setDragState(I)V
.locals 2
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mParentView:Landroid/view/ViewGroup;
iget-object v1, p0, Landroidx/customview/widget/ViewDragHelper;->mSetIdleRunnable:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/view/ViewGroup;->removeCallbacks(Ljava/lang/Runnable;)Z
iget v0, p0, Landroidx/customview/widget/ViewDragHelper;->mDragState:I
if-eq v0, p1, :cond_0
iput p1, p0, Landroidx/customview/widget/ViewDragHelper;->mDragState:I
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
invoke-virtual {v0, p1}, Landroidx/customview/widget/ViewDragHelper$Callback;->onViewDragStateChanged(I)V
iget p1, p0, Landroidx/customview/widget/ViewDragHelper;->mDragState:I
if-nez p1, :cond_0
const/4 p1, 0x0
iput-object p1, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
:cond_0
return-void
.end method
.method public setEdgeTrackingEnabled(I)V
.locals 0
iput p1, p0, Landroidx/customview/widget/ViewDragHelper;->mTrackingEdges:I
return-void
.end method
.method public setMinVelocity(F)V
.locals 0
iput p1, p0, Landroidx/customview/widget/ViewDragHelper;->mMinVelocity:F
return-void
.end method
.method public settleCapturedViewAt(II)Z
.locals 3
iget-boolean v0, p0, Landroidx/customview/widget/ViewDragHelper;->mReleaseInProgress:Z
if-eqz v0, :cond_0
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mVelocityTracker:Landroid/view/VelocityTracker;
iget v1, p0, Landroidx/customview/widget/ViewDragHelper;->mActivePointerId:I
invoke-virtual {v0, v1}, Landroid/view/VelocityTracker;->getXVelocity(I)F
move-result v0
float-to-int v0, v0
iget-object v1, p0, Landroidx/customview/widget/ViewDragHelper;->mVelocityTracker:Landroid/view/VelocityTracker;
iget v2, p0, Landroidx/customview/widget/ViewDragHelper;->mActivePointerId:I
invoke-virtual {v1, v2}, Landroid/view/VelocityTracker;->getYVelocity(I)F
move-result v1
float-to-int v1, v1
invoke-direct {p0, p1, p2, v0, v1}, Landroidx/customview/widget/ViewDragHelper;->forceSettleCapturedViewAt(IIII)Z
move-result p1
return p1
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
const-string p2, "Cannot settleCapturedViewAt outside of a call to Callback#onViewReleased"
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public shouldInterceptTouchEvent(Landroid/view/MotionEvent;)Z
.locals 16
.param p1 # Landroid/view/MotionEvent;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
move-object/from16 v0, p0
move-object/from16 v1, p1
invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getActionMasked()I
move-result v2
invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getActionIndex()I
move-result v3
if-nez v2, :cond_0
invoke-virtual/range {p0 .. p0}, Landroidx/customview/widget/ViewDragHelper;->cancel()V
:cond_0
iget-object v4, v0, Landroidx/customview/widget/ViewDragHelper;->mVelocityTracker:Landroid/view/VelocityTracker;
if-nez v4, :cond_1
invoke-static {}, Landroid/view/VelocityTracker;->obtain()Landroid/view/VelocityTracker;
move-result-object v4
iput-object v4, v0, Landroidx/customview/widget/ViewDragHelper;->mVelocityTracker:Landroid/view/VelocityTracker;
:cond_1
iget-object v4, v0, Landroidx/customview/widget/ViewDragHelper;->mVelocityTracker:Landroid/view/VelocityTracker;
invoke-virtual {v4, v1}, Landroid/view/VelocityTracker;->addMovement(Landroid/view/MotionEvent;)V
const/4 v4, 0x2
const/4 v6, 0x1
packed-switch v2, :pswitch_data_0
:pswitch_0
goto/16 :goto_2
:pswitch_1
invoke-virtual {v1, v3}, Landroid/view/MotionEvent;->getPointerId(I)I
move-result v1
invoke-direct {v0, v1}, Landroidx/customview/widget/ViewDragHelper;->clearMotionHistory(I)V
goto/16 :goto_2
:pswitch_2
invoke-virtual {v1, v3}, Landroid/view/MotionEvent;->getPointerId(I)I
move-result v2
invoke-virtual {v1, v3}, Landroid/view/MotionEvent;->getX(I)F
move-result v7
invoke-virtual {v1, v3}, Landroid/view/MotionEvent;->getY(I)F
move-result v1
invoke-direct {v0, v7, v1, v2}, Landroidx/customview/widget/ViewDragHelper;->saveInitialMotion(FFI)V
iget v3, v0, Landroidx/customview/widget/ViewDragHelper;->mDragState:I
if-nez v3, :cond_2
iget-object v1, v0, Landroidx/customview/widget/ViewDragHelper;->mInitialEdgesTouched:[I
aget v1, v1, v2
iget v3, v0, Landroidx/customview/widget/ViewDragHelper;->mTrackingEdges:I
2019-02-04 20:29:01 +00:00
and-int v4, v1, v3
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
if-eqz v4, :cond_9
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
iget-object v4, v0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
and-int/2addr v1, v3
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
invoke-virtual {v4, v1, v2}, Landroidx/customview/widget/ViewDragHelper$Callback;->onEdgeTouched(II)V
2019-02-04 20:08:30 +00:00
goto/16 :goto_2
:cond_2
if-ne v3, v4, :cond_9
float-to-int v3, v7
float-to-int v1, v1
invoke-virtual {v0, v3, v1}, Landroidx/customview/widget/ViewDragHelper;->findTopChildUnder(II)Landroid/view/View;
move-result-object v1
iget-object v3, v0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
if-ne v1, v3, :cond_9
invoke-virtual {v0, v1, v2}, Landroidx/customview/widget/ViewDragHelper;->tryCaptureViewForDrag(Landroid/view/View;I)Z
goto/16 :goto_2
:pswitch_3
iget-object v2, v0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionX:[F
if-eqz v2, :cond_9
iget-object v2, v0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionY:[F
if-eqz v2, :cond_9
invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getPointerCount()I
move-result v2
const/4 v3, 0x0
:goto_0
if-ge v3, v2, :cond_7
invoke-virtual {v1, v3}, Landroid/view/MotionEvent;->getPointerId(I)I
move-result v4
invoke-direct {v0, v4}, Landroidx/customview/widget/ViewDragHelper;->isValidPointerForActionMove(I)Z
move-result v7
if-eqz v7, :cond_6
invoke-virtual {v1, v3}, Landroid/view/MotionEvent;->getX(I)F
move-result v7
invoke-virtual {v1, v3}, Landroid/view/MotionEvent;->getY(I)F
move-result v8
iget-object v9, v0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionX:[F
aget v9, v9, v4
sub-float v9, v7, v9
iget-object v10, v0, Landroidx/customview/widget/ViewDragHelper;->mInitialMotionY:[F
aget v10, v10, v4
sub-float v10, v8, v10
float-to-int v7, v7
float-to-int v8, v8
invoke-virtual {v0, v7, v8}, Landroidx/customview/widget/ViewDragHelper;->findTopChildUnder(II)Landroid/view/View;
move-result-object v7
if-eqz v7, :cond_3
invoke-direct {v0, v7, v9, v10}, Landroidx/customview/widget/ViewDragHelper;->checkTouchSlop(Landroid/view/View;FF)Z
move-result v8
if-eqz v8, :cond_3
const/4 v8, 0x1
goto :goto_1
:cond_3
const/4 v8, 0x0
:goto_1
if-eqz v8, :cond_5
invoke-virtual {v7}, Landroid/view/View;->getLeft()I
move-result v11
float-to-int v12, v9
add-int v13, v11, v12
iget-object v14, v0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
invoke-virtual {v14, v7, v13, v12}, Landroidx/customview/widget/ViewDragHelper$Callback;->clampViewPositionHorizontal(Landroid/view/View;II)I
move-result v12
invoke-virtual {v7}, Landroid/view/View;->getTop()I
move-result v13
float-to-int v14, v10
add-int v15, v13, v14
iget-object v5, v0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
invoke-virtual {v5, v7, v15, v14}, Landroidx/customview/widget/ViewDragHelper$Callback;->clampViewPositionVertical(Landroid/view/View;II)I
move-result v5
iget-object v14, v0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
invoke-virtual {v14, v7}, Landroidx/customview/widget/ViewDragHelper$Callback;->getViewHorizontalDragRange(Landroid/view/View;)I
move-result v14
iget-object v15, v0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
invoke-virtual {v15, v7}, Landroidx/customview/widget/ViewDragHelper$Callback;->getViewVerticalDragRange(Landroid/view/View;)I
move-result v15
if-eqz v14, :cond_4
if-lez v14, :cond_5
if-ne v12, v11, :cond_5
:cond_4
if-eqz v15, :cond_7
if-lez v15, :cond_5
if-eq v5, v13, :cond_7
:cond_5
invoke-direct {v0, v9, v10, v4}, Landroidx/customview/widget/ViewDragHelper;->reportNewEdgeDrags(FFI)V
iget v5, v0, Landroidx/customview/widget/ViewDragHelper;->mDragState:I
if-eq v5, v6, :cond_7
if-eqz v8, :cond_6
invoke-virtual {v0, v7, v4}, Landroidx/customview/widget/ViewDragHelper;->tryCaptureViewForDrag(Landroid/view/View;I)Z
move-result v4
if-nez v4, :cond_7
:cond_6
add-int/lit8 v3, v3, 0x1
goto :goto_0
:cond_7
invoke-direct/range {p0 .. p1}, Landroidx/customview/widget/ViewDragHelper;->saveLastMotion(Landroid/view/MotionEvent;)V
goto :goto_2
:pswitch_4
invoke-virtual/range {p0 .. p0}, Landroidx/customview/widget/ViewDragHelper;->cancel()V
goto :goto_2
:pswitch_5
invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getX()F
move-result v2
invoke-virtual/range {p1 .. p1}, Landroid/view/MotionEvent;->getY()F
move-result v3
const/4 v5, 0x0
invoke-virtual {v1, v5}, Landroid/view/MotionEvent;->getPointerId(I)I
move-result v1
invoke-direct {v0, v2, v3, v1}, Landroidx/customview/widget/ViewDragHelper;->saveInitialMotion(FFI)V
float-to-int v2, v2
float-to-int v3, v3
invoke-virtual {v0, v2, v3}, Landroidx/customview/widget/ViewDragHelper;->findTopChildUnder(II)Landroid/view/View;
move-result-object v2
iget-object v3, v0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
if-ne v2, v3, :cond_8
iget v3, v0, Landroidx/customview/widget/ViewDragHelper;->mDragState:I
if-ne v3, v4, :cond_8
invoke-virtual {v0, v2, v1}, Landroidx/customview/widget/ViewDragHelper;->tryCaptureViewForDrag(Landroid/view/View;I)Z
:cond_8
iget-object v2, v0, Landroidx/customview/widget/ViewDragHelper;->mInitialEdgesTouched:[I
aget v2, v2, v1
iget v3, v0, Landroidx/customview/widget/ViewDragHelper;->mTrackingEdges:I
2019-02-04 20:29:01 +00:00
and-int v4, v2, v3
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
if-eqz v4, :cond_9
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
iget-object v4, v0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
and-int/2addr v2, v3
2019-02-04 20:08:30 +00:00
2019-02-04 20:29:01 +00:00
invoke-virtual {v4, v2, v1}, Landroidx/customview/widget/ViewDragHelper$Callback;->onEdgeTouched(II)V
2019-02-04 20:08:30 +00:00
:cond_9
:goto_2
iget v1, v0, Landroidx/customview/widget/ViewDragHelper;->mDragState:I
if-ne v1, v6, :cond_a
return v6
:cond_a
const/4 v1, 0x0
return v1
:pswitch_data_0
.packed-switch 0x0
:pswitch_5
:pswitch_4
:pswitch_3
:pswitch_4
:pswitch_0
:pswitch_2
:pswitch_1
.end packed-switch
.end method
.method public smoothSlideViewTo(Landroid/view/View;II)Z
.locals 0
.param p1 # Landroid/view/View;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
iput-object p1, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
const/4 p1, -0x1
iput p1, p0, Landroidx/customview/widget/ViewDragHelper;->mActivePointerId:I
const/4 p1, 0x0
invoke-direct {p0, p2, p3, p1, p1}, Landroidx/customview/widget/ViewDragHelper;->forceSettleCapturedViewAt(IIII)Z
move-result p1
if-nez p1, :cond_0
iget p2, p0, Landroidx/customview/widget/ViewDragHelper;->mDragState:I
if-nez p2, :cond_0
iget-object p2, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
if-eqz p2, :cond_0
const/4 p2, 0x0
iput-object p2, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
:cond_0
return p1
.end method
.method tryCaptureViewForDrag(Landroid/view/View;I)Z
.locals 2
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mCapturedView:Landroid/view/View;
const/4 v1, 0x1
if-ne p1, v0, :cond_0
iget v0, p0, Landroidx/customview/widget/ViewDragHelper;->mActivePointerId:I
if-ne v0, p2, :cond_0
return v1
:cond_0
if-eqz p1, :cond_1
iget-object v0, p0, Landroidx/customview/widget/ViewDragHelper;->mCallback:Landroidx/customview/widget/ViewDragHelper$Callback;
invoke-virtual {v0, p1, p2}, Landroidx/customview/widget/ViewDragHelper$Callback;->tryCaptureView(Landroid/view/View;I)Z
move-result v0
if-eqz v0, :cond_1
iput p2, p0, Landroidx/customview/widget/ViewDragHelper;->mActivePointerId:I
invoke-virtual {p0, p1, p2}, Landroidx/customview/widget/ViewDragHelper;->captureChildView(Landroid/view/View;I)V
return v1
:cond_1
const/4 p1, 0x0
return p1
.end method