apkfuckery/com.discord/smali/androidx/appcompat/widget/AppCompatSpinner$DropdownPopup.smali

411 lines
12 KiB
Smali
Raw Normal View History

2019-12-06 03:29:40 +00:00
.class public Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;
2019-07-24 11:27:29 +00:00
.super Landroidx/appcompat/widget/ListPopupWindow;
.source "AppCompatSpinner.java"
2019-11-15 02:21:15 +00:00
# interfaces
.implements Landroidx/appcompat/widget/AppCompatSpinner$SpinnerPopup;
2019-07-24 11:27:29 +00:00
# annotations
2019-12-06 03:29:40 +00:00
.annotation build Landroidx/annotation/VisibleForTesting;
.end annotation
2019-07-24 11:27:29 +00:00
.annotation system Ldalvik/annotation/EnclosingClass;
value = Landroidx/appcompat/widget/AppCompatSpinner;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
2019-12-06 03:29:40 +00:00
accessFlags = 0x1
2019-07-24 11:27:29 +00:00
name = "DropdownPopup"
.end annotation
# instance fields
2019-12-06 03:29:40 +00:00
.field public mAdapter:Landroid/widget/ListAdapter;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mHintText:Ljava/lang/CharSequence;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mOriginalHorizontalOffset:I
2019-11-15 02:21:15 +00:00
2019-12-06 03:29:40 +00:00
.field public final mVisibleRect:Landroid/graphics/Rect;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final synthetic this$0:Landroidx/appcompat/widget/AppCompatSpinner;
2019-07-24 11:27:29 +00:00
# direct methods
.method public constructor <init>(Landroidx/appcompat/widget/AppCompatSpinner;Landroid/content/Context;Landroid/util/AttributeSet;I)V
.locals 0
iput-object p1, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->this$0:Landroidx/appcompat/widget/AppCompatSpinner;
invoke-direct {p0, p2, p3, p4}, Landroidx/appcompat/widget/ListPopupWindow;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
new-instance p2, Landroid/graphics/Rect;
invoke-direct {p2}, Landroid/graphics/Rect;-><init>()V
iput-object p2, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->mVisibleRect:Landroid/graphics/Rect;
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, p1}, Landroidx/appcompat/widget/ListPopupWindow;->setAnchorView(Landroid/view/View;)V
2019-07-24 11:27:29 +00:00
const/4 p2, 0x1
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, p2}, Landroidx/appcompat/widget/ListPopupWindow;->setModal(Z)V
2019-07-24 11:27:29 +00:00
const/4 p2, 0x0
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, p2}, Landroidx/appcompat/widget/ListPopupWindow;->setPromptPosition(I)V
2019-07-24 11:27:29 +00:00
new-instance p2, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup$1;
invoke-direct {p2, p0, p1}, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup$1;-><init>(Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;Landroidx/appcompat/widget/AppCompatSpinner;)V
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, p2}, Landroidx/appcompat/widget/ListPopupWindow;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V
2019-07-24 11:27:29 +00:00
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public static synthetic access$001(Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;)V
2019-07-24 11:27:29 +00:00
.locals 0
invoke-super {p0}, Landroidx/appcompat/widget/ListPopupWindow;->show()V
return-void
.end method
# virtual methods
2019-12-06 03:29:40 +00:00
.method public computeContentWidth()V
.locals 8
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroidx/appcompat/widget/ListPopupWindow;->getBackground()Landroid/graphics/drawable/Drawable;
2019-07-24 11:27:29 +00:00
move-result-object v0
const/4 v1, 0x0
if-eqz v0, :cond_1
iget-object v1, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->this$0:Landroidx/appcompat/widget/AppCompatSpinner;
iget-object v1, v1, Landroidx/appcompat/widget/AppCompatSpinner;->mTempRect:Landroid/graphics/Rect;
invoke-virtual {v0, v1}, Landroid/graphics/drawable/Drawable;->getPadding(Landroid/graphics/Rect;)Z
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->this$0:Landroidx/appcompat/widget/AppCompatSpinner;
invoke-static {v0}, Landroidx/appcompat/widget/ViewUtils;->isLayoutRtl(Landroid/view/View;)Z
move-result v0
if-eqz v0, :cond_0
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->this$0:Landroidx/appcompat/widget/AppCompatSpinner;
iget-object v0, v0, Landroidx/appcompat/widget/AppCompatSpinner;->mTempRect:Landroid/graphics/Rect;
iget v0, v0, Landroid/graphics/Rect;->right:I
goto :goto_0
:cond_0
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->this$0:Landroidx/appcompat/widget/AppCompatSpinner;
iget-object v0, v0, Landroidx/appcompat/widget/AppCompatSpinner;->mTempRect:Landroid/graphics/Rect;
iget v0, v0, Landroid/graphics/Rect;->left:I
neg-int v0, v0
:goto_0
move v1, v0
goto :goto_1
:cond_1
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->this$0:Landroidx/appcompat/widget/AppCompatSpinner;
iget-object v0, v0, Landroidx/appcompat/widget/AppCompatSpinner;->mTempRect:Landroid/graphics/Rect;
2019-12-06 03:29:40 +00:00
iput v1, v0, Landroid/graphics/Rect;->right:I
2019-07-24 11:27:29 +00:00
iput v1, v0, Landroid/graphics/Rect;->left:I
:goto_1
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->this$0:Landroidx/appcompat/widget/AppCompatSpinner;
2019-12-06 03:29:40 +00:00
invoke-virtual {v0}, Landroid/widget/Spinner;->getPaddingLeft()I
2019-07-24 11:27:29 +00:00
move-result v0
iget-object v2, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->this$0:Landroidx/appcompat/widget/AppCompatSpinner;
2019-12-06 03:29:40 +00:00
invoke-virtual {v2}, Landroid/widget/Spinner;->getPaddingRight()I
2019-07-24 11:27:29 +00:00
move-result v2
iget-object v3, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->this$0:Landroidx/appcompat/widget/AppCompatSpinner;
2019-12-06 03:29:40 +00:00
invoke-virtual {v3}, Landroid/widget/Spinner;->getWidth()I
2019-07-24 11:27:29 +00:00
move-result v3
iget-object v4, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->this$0:Landroidx/appcompat/widget/AppCompatSpinner;
2019-12-06 03:29:40 +00:00
iget v5, v4, Landroidx/appcompat/widget/AppCompatSpinner;->mDropDownWidth:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const/4 v6, -0x2
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
if-ne v5, v6, :cond_3
2019-07-24 11:27:29 +00:00
iget-object v5, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->mAdapter:Landroid/widget/ListAdapter;
check-cast v5, Landroid/widget/SpinnerAdapter;
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroidx/appcompat/widget/ListPopupWindow;->getBackground()Landroid/graphics/drawable/Drawable;
2019-07-24 11:27:29 +00:00
move-result-object v6
invoke-virtual {v4, v5, v6}, Landroidx/appcompat/widget/AppCompatSpinner;->compatMeasureContentWidth(Landroid/widget/SpinnerAdapter;Landroid/graphics/drawable/Drawable;)I
move-result v4
iget-object v5, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->this$0:Landroidx/appcompat/widget/AppCompatSpinner;
2019-12-06 03:29:40 +00:00
invoke-virtual {v5}, Landroid/widget/Spinner;->getContext()Landroid/content/Context;
2019-07-24 11:27:29 +00:00
move-result-object v5
invoke-virtual {v5}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v5
invoke-virtual {v5}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
move-result-object v5
iget v5, v5, Landroid/util/DisplayMetrics;->widthPixels:I
iget-object v6, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->this$0:Landroidx/appcompat/widget/AppCompatSpinner;
iget-object v6, v6, Landroidx/appcompat/widget/AppCompatSpinner;->mTempRect:Landroid/graphics/Rect;
2019-12-06 03:29:40 +00:00
iget v7, v6, Landroid/graphics/Rect;->left:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
sub-int/2addr v5, v7
2019-07-24 11:27:29 +00:00
iget v6, v6, Landroid/graphics/Rect;->right:I
sub-int/2addr v5, v6
if-le v4, v5, :cond_2
move v4, v5
:cond_2
sub-int v5, v3, v0
sub-int/2addr v5, v2
invoke-static {v4, v5}, Ljava/lang/Math;->max(II)I
move-result v4
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, v4}, Landroidx/appcompat/widget/ListPopupWindow;->setContentWidth(I)V
2019-07-24 11:27:29 +00:00
goto :goto_2
:cond_3
2019-12-06 03:29:40 +00:00
const/4 v4, -0x1
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
if-ne v5, v4, :cond_4
2019-07-24 11:27:29 +00:00
sub-int v4, v3, v0
sub-int/2addr v4, v2
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, v4}, Landroidx/appcompat/widget/ListPopupWindow;->setContentWidth(I)V
2019-07-24 11:27:29 +00:00
goto :goto_2
:cond_4
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, v5}, Landroidx/appcompat/widget/ListPopupWindow;->setContentWidth(I)V
2019-07-24 11:27:29 +00:00
:goto_2
iget-object v4, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->this$0:Landroidx/appcompat/widget/AppCompatSpinner;
invoke-static {v4}, Landroidx/appcompat/widget/ViewUtils;->isLayoutRtl(Landroid/view/View;)Z
move-result v4
if-eqz v4, :cond_5
sub-int/2addr v3, v2
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroidx/appcompat/widget/ListPopupWindow;->getWidth()I
2019-07-24 11:27:29 +00:00
move-result v0
sub-int/2addr v3, v0
2019-11-15 02:21:15 +00:00
invoke-virtual {p0}, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->getHorizontalOriginalOffset()I
move-result v0
sub-int/2addr v3, v0
2019-12-06 03:29:40 +00:00
add-int/2addr v3, v1
2019-07-24 11:27:29 +00:00
goto :goto_3
:cond_5
2019-11-15 02:21:15 +00:00
invoke-virtual {p0}, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->getHorizontalOriginalOffset()I
move-result v2
2019-12-06 03:29:40 +00:00
add-int/2addr v2, v0
2019-11-15 02:21:15 +00:00
2019-12-06 03:29:40 +00:00
add-int v3, v2, v1
2019-07-24 11:27:29 +00:00
:goto_3
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, v3}, Landroidx/appcompat/widget/ListPopupWindow;->setHorizontalOffset(I)V
2019-07-24 11:27:29 +00:00
return-void
.end method
.method public getHintText()Ljava/lang/CharSequence;
.locals 1
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->mHintText:Ljava/lang/CharSequence;
return-object v0
.end method
2019-11-15 02:21:15 +00:00
.method public getHorizontalOriginalOffset()I
.locals 1
iget v0, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->mOriginalHorizontalOffset:I
return v0
.end method
2019-12-06 03:29:40 +00:00
.method public isVisibleToUser(Landroid/view/View;)Z
2019-07-24 11:27:29 +00:00
.locals 1
invoke-static {p1}, Landroidx/core/view/ViewCompat;->isAttachedToWindow(Landroid/view/View;)Z
move-result v0
if-eqz v0, :cond_0
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->mVisibleRect:Landroid/graphics/Rect;
invoke-virtual {p1, v0}, Landroid/view/View;->getGlobalVisibleRect(Landroid/graphics/Rect;)Z
move-result p1
if-eqz p1, :cond_0
const/4 p1, 0x1
2019-12-06 03:29:40 +00:00
goto :goto_0
2019-07-24 11:27:29 +00:00
:cond_0
const/4 p1, 0x0
2019-12-06 03:29:40 +00:00
:goto_0
2019-07-24 11:27:29 +00:00
return p1
.end method
.method public setAdapter(Landroid/widget/ListAdapter;)V
.locals 0
invoke-super {p0, p1}, Landroidx/appcompat/widget/ListPopupWindow;->setAdapter(Landroid/widget/ListAdapter;)V
iput-object p1, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->mAdapter:Landroid/widget/ListAdapter;
return-void
.end method
2019-11-15 02:21:15 +00:00
.method public setHorizontalOriginalOffset(I)V
.locals 0
iput p1, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->mOriginalHorizontalOffset:I
return-void
.end method
2019-07-24 11:27:29 +00:00
.method public setPromptText(Ljava/lang/CharSequence;)V
.locals 0
iput-object p1, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->mHintText:Ljava/lang/CharSequence;
return-void
.end method
2019-11-15 02:21:15 +00:00
.method public show(II)V
2019-12-06 03:29:40 +00:00
.locals 3
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroidx/appcompat/widget/ListPopupWindow;->isShowing()Z
2019-07-24 11:27:29 +00:00
move-result v0
invoke-virtual {p0}, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->computeContentWidth()V
const/4 v1, 0x2
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, v1}, Landroidx/appcompat/widget/ListPopupWindow;->setInputMethodMode(I)V
2019-07-24 11:27:29 +00:00
invoke-super {p0}, Landroidx/appcompat/widget/ListPopupWindow;->show()V
2019-12-06 03:29:40 +00:00
invoke-virtual {p0}, Landroidx/appcompat/widget/ListPopupWindow;->getListView()Landroid/widget/ListView;
2019-07-24 11:27:29 +00:00
move-result-object v1
const/4 v2, 0x1
invoke-virtual {v1, v2}, Landroid/widget/ListView;->setChoiceMode(I)V
2019-11-15 02:21:15 +00:00
sget v2, Landroid/os/Build$VERSION;->SDK_INT:I
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-virtual {v1, p1}, Landroid/widget/ListView;->setTextDirection(I)V
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
invoke-virtual {v1, p2}, Landroid/widget/ListView;->setTextAlignment(I)V
2019-07-24 11:27:29 +00:00
2019-11-15 02:21:15 +00:00
iget-object p1, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->this$0:Landroidx/appcompat/widget/AppCompatSpinner;
2019-10-07 23:23:22 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p1}, Landroid/widget/Spinner;->getSelectedItemPosition()I
2019-10-07 23:23:22 +00:00
2019-11-15 02:21:15 +00:00
move-result p1
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, p1}, Landroidx/appcompat/widget/ListPopupWindow;->setSelection(I)V
2019-10-07 23:23:22 +00:00
2019-12-06 03:29:40 +00:00
if-eqz v0, :cond_0
2019-10-07 23:23:22 +00:00
2019-11-15 02:21:15 +00:00
return-void
2019-10-07 23:23:22 +00:00
2019-12-06 03:29:40 +00:00
:cond_0
2019-11-15 02:21:15 +00:00
iget-object p1, p0, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;->this$0:Landroidx/appcompat/widget/AppCompatSpinner;
2019-11-10 14:21:47 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {p1}, Landroid/widget/Spinner;->getViewTreeObserver()Landroid/view/ViewTreeObserver;
2019-11-10 14:21:47 +00:00
2019-11-15 02:21:15 +00:00
move-result-object p1
2019-11-10 14:21:47 +00:00
2019-12-06 03:29:40 +00:00
if-eqz p1, :cond_1
2019-11-10 14:21:47 +00:00
2019-11-15 02:21:15 +00:00
new-instance p2, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup$2;
2019-11-10 14:21:47 +00:00
2019-11-15 02:21:15 +00:00
invoke-direct {p2, p0}, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup$2;-><init>(Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;)V
invoke-virtual {p1, p2}, Landroid/view/ViewTreeObserver;->addOnGlobalLayoutListener(Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V
new-instance p1, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup$3;
invoke-direct {p1, p0, p2}, Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup$3;-><init>(Landroidx/appcompat/widget/AppCompatSpinner$DropdownPopup;Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V
2019-12-06 03:29:40 +00:00
invoke-virtual {p0, p1}, Landroidx/appcompat/widget/ListPopupWindow;->setOnDismissListener(Landroid/widget/PopupWindow$OnDismissListener;)V
2019-11-15 02:21:15 +00:00
2019-12-06 03:29:40 +00:00
:cond_1
2019-07-24 11:27:29 +00:00
return-void
.end method