252 lines
6.8 KiB
Smali
252 lines
6.8 KiB
Smali
.class Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;
|
|
.super Landroid/view/TouchDelegate;
|
|
.source "SearchView.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Landroidx/appcompat/widget/SearchView;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x8
|
|
name = "UpdatableTouchDelegate"
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field private final mActualBounds:Landroid/graphics/Rect;
|
|
|
|
.field private mDelegateTargeted:Z
|
|
|
|
.field private final mDelegateView:Landroid/view/View;
|
|
|
|
.field private final mSlop:I
|
|
|
|
.field private final mSlopBounds:Landroid/graphics/Rect;
|
|
|
|
.field private final mTargetBounds:Landroid/graphics/Rect;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/view/View;)V
|
|
.locals 1
|
|
|
|
invoke-direct {p0, p1, p3}, Landroid/view/TouchDelegate;-><init>(Landroid/graphics/Rect;Landroid/view/View;)V
|
|
|
|
invoke-virtual {p3}, Landroid/view/View;->getContext()Landroid/content/Context;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Landroid/view/ViewConfiguration;->get(Landroid/content/Context;)Landroid/view/ViewConfiguration;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Landroid/view/ViewConfiguration;->getScaledTouchSlop()I
|
|
|
|
move-result v0
|
|
|
|
iput v0, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mSlop:I
|
|
|
|
new-instance v0, Landroid/graphics/Rect;
|
|
|
|
invoke-direct {v0}, Landroid/graphics/Rect;-><init>()V
|
|
|
|
iput-object v0, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mTargetBounds:Landroid/graphics/Rect;
|
|
|
|
new-instance v0, Landroid/graphics/Rect;
|
|
|
|
invoke-direct {v0}, Landroid/graphics/Rect;-><init>()V
|
|
|
|
iput-object v0, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mSlopBounds:Landroid/graphics/Rect;
|
|
|
|
new-instance v0, Landroid/graphics/Rect;
|
|
|
|
invoke-direct {v0}, Landroid/graphics/Rect;-><init>()V
|
|
|
|
iput-object v0, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mActualBounds:Landroid/graphics/Rect;
|
|
|
|
invoke-virtual {p0, p1, p2}, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->setBounds(Landroid/graphics/Rect;Landroid/graphics/Rect;)V
|
|
|
|
iput-object p3, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mDelegateView:Landroid/view/View;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
|
|
.locals 7
|
|
|
|
invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F
|
|
|
|
move-result v0
|
|
|
|
float-to-int v0, v0
|
|
|
|
invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F
|
|
|
|
move-result v1
|
|
|
|
float-to-int v1, v1
|
|
|
|
invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, 0x2
|
|
|
|
const/4 v4, 0x1
|
|
|
|
const/4 v5, 0x0
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
if-eq v2, v4, :cond_1
|
|
|
|
if-eq v2, v3, :cond_1
|
|
|
|
const/4 v6, 0x3
|
|
|
|
if-eq v2, v6, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-boolean v2, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mDelegateTargeted:Z
|
|
|
|
iput-boolean v5, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mDelegateTargeted:Z
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
iget-boolean v2, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mDelegateTargeted:Z
|
|
|
|
if-eqz v2, :cond_4
|
|
|
|
iget-object v6, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mSlopBounds:Landroid/graphics/Rect;
|
|
|
|
invoke-virtual {v6, v0, v1}, Landroid/graphics/Rect;->contains(II)Z
|
|
|
|
move-result v6
|
|
|
|
if-nez v6, :cond_4
|
|
|
|
const/4 v4, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
iget-object v2, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mTargetBounds:Landroid/graphics/Rect;
|
|
|
|
invoke-virtual {v2, v0, v1}, Landroid/graphics/Rect;->contains(II)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_3
|
|
|
|
iput-boolean v4, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mDelegateTargeted:Z
|
|
|
|
const/4 v2, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
:goto_0
|
|
const/4 v2, 0x0
|
|
|
|
:cond_4
|
|
:goto_1
|
|
if-eqz v2, :cond_6
|
|
|
|
if-eqz v4, :cond_5
|
|
|
|
iget-object v2, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mActualBounds:Landroid/graphics/Rect;
|
|
|
|
invoke-virtual {v2, v0, v1}, Landroid/graphics/Rect;->contains(II)Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_5
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mDelegateView:Landroid/view/View;
|
|
|
|
invoke-virtual {v0}, Landroid/view/View;->getWidth()I
|
|
|
|
move-result v0
|
|
|
|
div-int/2addr v0, v3
|
|
|
|
int-to-float v0, v0
|
|
|
|
iget-object v1, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mDelegateView:Landroid/view/View;
|
|
|
|
invoke-virtual {v1}, Landroid/view/View;->getHeight()I
|
|
|
|
move-result v1
|
|
|
|
div-int/2addr v1, v3
|
|
|
|
int-to-float v1, v1
|
|
|
|
invoke-virtual {p1, v0, v1}, Landroid/view/MotionEvent;->setLocation(FF)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_5
|
|
iget-object v2, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mActualBounds:Landroid/graphics/Rect;
|
|
|
|
iget v2, v2, Landroid/graphics/Rect;->left:I
|
|
|
|
sub-int/2addr v0, v2
|
|
|
|
int-to-float v0, v0
|
|
|
|
iget-object v2, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mActualBounds:Landroid/graphics/Rect;
|
|
|
|
iget v2, v2, Landroid/graphics/Rect;->top:I
|
|
|
|
sub-int/2addr v1, v2
|
|
|
|
int-to-float v1, v1
|
|
|
|
invoke-virtual {p1, v0, v1}, Landroid/view/MotionEvent;->setLocation(FF)V
|
|
|
|
:goto_2
|
|
iget-object v0, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mDelegateView:Landroid/view/View;
|
|
|
|
invoke-virtual {v0, p1}, Landroid/view/View;->dispatchTouchEvent(Landroid/view/MotionEvent;)Z
|
|
|
|
move-result v5
|
|
|
|
:cond_6
|
|
return v5
|
|
.end method
|
|
|
|
.method public setBounds(Landroid/graphics/Rect;Landroid/graphics/Rect;)V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mTargetBounds:Landroid/graphics/Rect;
|
|
|
|
invoke-virtual {v0, p1}, Landroid/graphics/Rect;->set(Landroid/graphics/Rect;)V
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mSlopBounds:Landroid/graphics/Rect;
|
|
|
|
invoke-virtual {v0, p1}, Landroid/graphics/Rect;->set(Landroid/graphics/Rect;)V
|
|
|
|
iget-object p1, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mSlopBounds:Landroid/graphics/Rect;
|
|
|
|
iget v0, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mSlop:I
|
|
|
|
neg-int v1, v0
|
|
|
|
neg-int v0, v0
|
|
|
|
invoke-virtual {p1, v1, v0}, Landroid/graphics/Rect;->inset(II)V
|
|
|
|
iget-object p1, p0, Landroidx/appcompat/widget/SearchView$UpdatableTouchDelegate;->mActualBounds:Landroid/graphics/Rect;
|
|
|
|
invoke-virtual {p1, p2}, Landroid/graphics/Rect;->set(Landroid/graphics/Rect;)V
|
|
|
|
return-void
|
|
.end method
|