1626 lines
46 KiB
Smali
1626 lines
46 KiB
Smali
.class public final Landroidx/appcompat/view/menu/CascadingMenuPopup;
|
|
.super Landroidx/appcompat/view/menu/MenuPopup;
|
|
.source "CascadingMenuPopup.java"
|
|
|
|
# interfaces
|
|
.implements Landroidx/appcompat/view/menu/MenuPresenter;
|
|
.implements Landroid/view/View$OnKeyListener;
|
|
.implements Landroid/widget/PopupWindow$OnDismissListener;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;,
|
|
Landroidx/appcompat/view/menu/CascadingMenuPopup$HorizPosition;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final HORIZ_POSITION_LEFT:I = 0x0
|
|
|
|
.field public static final HORIZ_POSITION_RIGHT:I = 0x1
|
|
|
|
.field public static final ITEM_LAYOUT:I
|
|
|
|
.field public static final SUBMENU_TIMEOUT_MS:I = 0xc8
|
|
|
|
|
|
# instance fields
|
|
.field public mAnchorView:Landroid/view/View;
|
|
|
|
.field public final mAttachStateChangeListener:Landroid/view/View$OnAttachStateChangeListener;
|
|
|
|
.field public final mContext:Landroid/content/Context;
|
|
|
|
.field public mDropDownGravity:I
|
|
|
|
.field public mForceShowIcon:Z
|
|
|
|
.field public final mGlobalLayoutListener:Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;
|
|
|
|
.field public mHasXOffset:Z
|
|
|
|
.field public mHasYOffset:Z
|
|
|
|
.field public mLastPosition:I
|
|
|
|
.field public final mMenuItemHoverListener:Landroidx/appcompat/widget/MenuItemHoverListener;
|
|
|
|
.field public final mMenuMaxWidth:I
|
|
|
|
.field public mOnDismissListener:Landroid/widget/PopupWindow$OnDismissListener;
|
|
|
|
.field public final mOverflowOnly:Z
|
|
|
|
.field public final mPendingMenus:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Landroidx/appcompat/view/menu/MenuBuilder;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final mPopupStyleAttr:I
|
|
|
|
.field public final mPopupStyleRes:I
|
|
|
|
.field public mPresenterCallback:Landroidx/appcompat/view/menu/MenuPresenter$Callback;
|
|
|
|
.field public mRawDropDownGravity:I
|
|
|
|
.field public mShouldCloseImmediately:Z
|
|
|
|
.field public mShowTitle:Z
|
|
|
|
.field public final mShowingMenus:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public mShownAnchorView:Landroid/view/View;
|
|
|
|
.field public final mSubMenuHoverHandler:Landroid/os/Handler;
|
|
|
|
.field public mTreeObserver:Landroid/view/ViewTreeObserver;
|
|
|
|
.field public mXOffset:I
|
|
|
|
.field public mYOffset:I
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
sget v0, Landroidx/appcompat/R$layout;->abc_cascading_menu_item_layout:I
|
|
|
|
sput v0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->ITEM_LAYOUT:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Landroid/view/View;IIZ)V
|
|
.locals 1
|
|
.param p1 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Landroid/view/View;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p3 # I
|
|
.annotation build Landroidx/annotation/AttrRes;
|
|
.end annotation
|
|
.end param
|
|
.param p4 # I
|
|
.annotation build Landroidx/annotation/StyleRes;
|
|
.end annotation
|
|
.end param
|
|
|
|
invoke-direct {p0}, Landroidx/appcompat/view/menu/MenuPopup;-><init>()V
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mPendingMenus:Ljava/util/List;
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
new-instance v0, Landroidx/appcompat/view/menu/CascadingMenuPopup$1;
|
|
|
|
invoke-direct {v0, p0}, Landroidx/appcompat/view/menu/CascadingMenuPopup$1;-><init>(Landroidx/appcompat/view/menu/CascadingMenuPopup;)V
|
|
|
|
iput-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mGlobalLayoutListener:Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;
|
|
|
|
new-instance v0, Landroidx/appcompat/view/menu/CascadingMenuPopup$2;
|
|
|
|
invoke-direct {v0, p0}, Landroidx/appcompat/view/menu/CascadingMenuPopup$2;-><init>(Landroidx/appcompat/view/menu/CascadingMenuPopup;)V
|
|
|
|
iput-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mAttachStateChangeListener:Landroid/view/View$OnAttachStateChangeListener;
|
|
|
|
new-instance v0, Landroidx/appcompat/view/menu/CascadingMenuPopup$3;
|
|
|
|
invoke-direct {v0, p0}, Landroidx/appcompat/view/menu/CascadingMenuPopup$3;-><init>(Landroidx/appcompat/view/menu/CascadingMenuPopup;)V
|
|
|
|
iput-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mMenuItemHoverListener:Landroidx/appcompat/widget/MenuItemHoverListener;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mRawDropDownGravity:I
|
|
|
|
iput v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mDropDownGravity:I
|
|
|
|
iput-object p1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mContext:Landroid/content/Context;
|
|
|
|
iput-object p2, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mAnchorView:Landroid/view/View;
|
|
|
|
iput p3, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mPopupStyleAttr:I
|
|
|
|
iput p4, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mPopupStyleRes:I
|
|
|
|
iput-boolean p5, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mOverflowOnly:Z
|
|
|
|
iput-boolean v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mForceShowIcon:Z
|
|
|
|
invoke-direct {p0}, Landroidx/appcompat/view/menu/CascadingMenuPopup;->getInitialMenuPosition()I
|
|
|
|
move-result p2
|
|
|
|
iput p2, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mLastPosition:I
|
|
|
|
invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
|
|
|
|
move-result-object p2
|
|
|
|
iget p2, p2, Landroid/util/DisplayMetrics;->widthPixels:I
|
|
|
|
div-int/lit8 p2, p2, 0x2
|
|
|
|
sget p3, Landroidx/appcompat/R$dimen;->abc_config_prefDialogWidth:I
|
|
|
|
invoke-virtual {p1, p3}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
|
|
|
|
move-result p1
|
|
|
|
invoke-static {p2, p1}, Ljava/lang/Math;->max(II)I
|
|
|
|
move-result p1
|
|
|
|
iput p1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mMenuMaxWidth:I
|
|
|
|
new-instance p1, Landroid/os/Handler;
|
|
|
|
invoke-direct {p1}, Landroid/os/Handler;-><init>()V
|
|
|
|
iput-object p1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mSubMenuHoverHandler:Landroid/os/Handler;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private createPopupWindow()Landroidx/appcompat/widget/MenuPopupWindow;
|
|
.locals 5
|
|
|
|
new-instance v0, Landroidx/appcompat/widget/MenuPopupWindow;
|
|
|
|
iget-object v1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mContext:Landroid/content/Context;
|
|
|
|
iget v2, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mPopupStyleAttr:I
|
|
|
|
iget v3, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mPopupStyleRes:I
|
|
|
|
const/4 v4, 0x0
|
|
|
|
invoke-direct {v0, v1, v4, v2, v3}, Landroidx/appcompat/widget/MenuPopupWindow;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;II)V
|
|
|
|
iget-object v1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mMenuItemHoverListener:Landroidx/appcompat/widget/MenuItemHoverListener;
|
|
|
|
invoke-virtual {v0, v1}, Landroidx/appcompat/widget/MenuPopupWindow;->setHoverListener(Landroidx/appcompat/widget/MenuItemHoverListener;)V
|
|
|
|
invoke-virtual {v0, p0}, Landroidx/appcompat/widget/ListPopupWindow;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V
|
|
|
|
invoke-virtual {v0, p0}, Landroidx/appcompat/widget/ListPopupWindow;->setOnDismissListener(Landroid/widget/PopupWindow$OnDismissListener;)V
|
|
|
|
iget-object v1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mAnchorView:Landroid/view/View;
|
|
|
|
invoke-virtual {v0, v1}, Landroidx/appcompat/widget/ListPopupWindow;->setAnchorView(Landroid/view/View;)V
|
|
|
|
iget v1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mDropDownGravity:I
|
|
|
|
invoke-virtual {v0, v1}, Landroidx/appcompat/widget/ListPopupWindow;->setDropDownGravity(I)V
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-virtual {v0, v1}, Landroidx/appcompat/widget/ListPopupWindow;->setModal(Z)V
|
|
|
|
const/4 v1, 0x2
|
|
|
|
invoke-virtual {v0, v1}, Landroidx/appcompat/widget/ListPopupWindow;->setInputMethodMode(I)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private findIndexOfAddedMenu(Landroidx/appcompat/view/menu/MenuBuilder;)I
|
|
.locals 3
|
|
.param p1 # Landroidx/appcompat/view/menu/MenuBuilder;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
if-ge v1, v0, :cond_1
|
|
|
|
iget-object v2, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v2, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;
|
|
|
|
iget-object v2, v2, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
if-ne p1, v2, :cond_0
|
|
|
|
return v1
|
|
|
|
:cond_0
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 p1, -0x1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method private findMenuItemForSubmenu(Landroidx/appcompat/view/menu/MenuBuilder;Landroidx/appcompat/view/menu/MenuBuilder;)Landroid/view/MenuItem;
|
|
.locals 4
|
|
.param p1 # Landroidx/appcompat/view/menu/MenuBuilder;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Landroidx/appcompat/view/menu/MenuBuilder;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
invoke-virtual {p1}, Landroidx/appcompat/view/menu/MenuBuilder;->size()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
if-ge v1, v0, :cond_1
|
|
|
|
invoke-virtual {p1, v1}, Landroidx/appcompat/view/menu/MenuBuilder;->getItem(I)Landroid/view/MenuItem;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v2}, Landroid/view/MenuItem;->hasSubMenu()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
invoke-interface {v2}, Landroid/view/MenuItem;->getSubMenu()Landroid/view/SubMenu;
|
|
|
|
move-result-object v3
|
|
|
|
if-ne p2, v3, :cond_0
|
|
|
|
return-object v2
|
|
|
|
:cond_0
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 p1, 0x0
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private findParentViewForSubmenu(Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;Landroidx/appcompat/view/menu/MenuBuilder;)Landroid/view/View;
|
|
.locals 7
|
|
.param p1 # Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Landroidx/appcompat/view/menu/MenuBuilder;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
iget-object v0, p1, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
invoke-direct {p0, v0, p2}, Landroidx/appcompat/view/menu/CascadingMenuPopup;->findMenuItemForSubmenu(Landroidx/appcompat/view/menu/MenuBuilder;Landroidx/appcompat/view/menu/MenuBuilder;)Landroid/view/MenuItem;
|
|
|
|
move-result-object p2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-nez p2, :cond_0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
invoke-virtual {p1}, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;->getListView()Landroid/widget/ListView;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Landroid/widget/ListView;->getAdapter()Landroid/widget/ListAdapter;
|
|
|
|
move-result-object v1
|
|
|
|
instance-of v2, v1, Landroid/widget/HeaderViewListAdapter;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
check-cast v1, Landroid/widget/HeaderViewListAdapter;
|
|
|
|
invoke-virtual {v1}, Landroid/widget/HeaderViewListAdapter;->getHeadersCount()I
|
|
|
|
move-result v2
|
|
|
|
invoke-virtual {v1}, Landroid/widget/HeaderViewListAdapter;->getWrappedAdapter()Landroid/widget/ListAdapter;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Landroidx/appcompat/view/menu/MenuAdapter;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
check-cast v1, Landroidx/appcompat/view/menu/MenuAdapter;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
invoke-virtual {v1}, Landroidx/appcompat/view/menu/MenuAdapter;->getCount()I
|
|
|
|
move-result v4
|
|
|
|
:goto_1
|
|
const/4 v5, -0x1
|
|
|
|
if-ge v3, v4, :cond_3
|
|
|
|
invoke-virtual {v1, v3}, Landroidx/appcompat/view/menu/MenuAdapter;->getItem(I)Landroidx/appcompat/view/menu/MenuItemImpl;
|
|
|
|
move-result-object v6
|
|
|
|
if-ne p2, v6, :cond_2
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
add-int/lit8 v3, v3, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
const/4 v3, -0x1
|
|
|
|
:goto_2
|
|
if-ne v3, v5, :cond_4
|
|
|
|
return-object v0
|
|
|
|
:cond_4
|
|
add-int/2addr v3, v2
|
|
|
|
invoke-virtual {p1}, Landroid/widget/ListView;->getFirstVisiblePosition()I
|
|
|
|
move-result p2
|
|
|
|
sub-int/2addr v3, p2
|
|
|
|
if-ltz v3, :cond_6
|
|
|
|
invoke-virtual {p1}, Landroid/widget/ListView;->getChildCount()I
|
|
|
|
move-result p2
|
|
|
|
if-lt v3, p2, :cond_5
|
|
|
|
goto :goto_3
|
|
|
|
:cond_5
|
|
invoke-virtual {p1, v3}, Landroid/widget/ListView;->getChildAt(I)Landroid/view/View;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
:cond_6
|
|
:goto_3
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private getInitialMenuPosition()I
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mAnchorView:Landroid/view/View;
|
|
|
|
invoke-static {v0}, Landroidx/core/view/ViewCompat;->getLayoutDirection(Landroid/view/View;)I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:cond_0
|
|
return v1
|
|
.end method
|
|
|
|
.method private getNextMenuPosition(I)I
|
|
.locals 6
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
sub-int/2addr v1, v2
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;
|
|
|
|
invoke-virtual {v0}, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;->getListView()Landroid/widget/ListView;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x2
|
|
|
|
new-array v1, v1, [I
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/ListView;->getLocationOnScreen([I)V
|
|
|
|
new-instance v3, Landroid/graphics/Rect;
|
|
|
|
invoke-direct {v3}, Landroid/graphics/Rect;-><init>()V
|
|
|
|
iget-object v4, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShownAnchorView:Landroid/view/View;
|
|
|
|
invoke-virtual {v4, v3}, Landroid/view/View;->getWindowVisibleDisplayFrame(Landroid/graphics/Rect;)V
|
|
|
|
iget v4, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mLastPosition:I
|
|
|
|
const/4 v5, 0x0
|
|
|
|
if-ne v4, v2, :cond_1
|
|
|
|
aget v1, v1, v5
|
|
|
|
invoke-virtual {v0}, Landroid/widget/ListView;->getWidth()I
|
|
|
|
move-result v0
|
|
|
|
add-int/2addr v0, v1
|
|
|
|
add-int/2addr v0, p1
|
|
|
|
iget p1, v3, Landroid/graphics/Rect;->right:I
|
|
|
|
if-le v0, p1, :cond_0
|
|
|
|
return v5
|
|
|
|
:cond_0
|
|
return v2
|
|
|
|
:cond_1
|
|
aget v0, v1, v5
|
|
|
|
sub-int/2addr v0, p1
|
|
|
|
if-gez v0, :cond_2
|
|
|
|
return v2
|
|
|
|
:cond_2
|
|
return v5
|
|
.end method
|
|
|
|
.method private showMenu(Landroidx/appcompat/view/menu/MenuBuilder;)V
|
|
.locals 14
|
|
.param p1 # Landroidx/appcompat/view/menu/MenuBuilder;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mContext:Landroid/content/Context;
|
|
|
|
invoke-static {v0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Landroidx/appcompat/view/menu/MenuAdapter;
|
|
|
|
iget-boolean v2, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mOverflowOnly:Z
|
|
|
|
sget v3, Landroidx/appcompat/view/menu/CascadingMenuPopup;->ITEM_LAYOUT:I
|
|
|
|
invoke-direct {v1, p1, v0, v2, v3}, Landroidx/appcompat/view/menu/MenuAdapter;-><init>(Landroidx/appcompat/view/menu/MenuBuilder;Landroid/view/LayoutInflater;ZI)V
|
|
|
|
invoke-virtual {p0}, Landroidx/appcompat/view/menu/CascadingMenuPopup;->isShowing()Z
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, 0x1
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
iget-boolean v2, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mForceShowIcon:Z
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
invoke-virtual {v1, v3}, Landroidx/appcompat/view/menu/MenuAdapter;->setForceShowIcon(Z)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {p0}, Landroidx/appcompat/view/menu/CascadingMenuPopup;->isShowing()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
invoke-static {p1}, Landroidx/appcompat/view/menu/MenuPopup;->shouldPreserveIconSpacing(Landroidx/appcompat/view/menu/MenuBuilder;)Z
|
|
|
|
move-result v2
|
|
|
|
invoke-virtual {v1, v2}, Landroidx/appcompat/view/menu/MenuAdapter;->setForceShowIcon(Z)V
|
|
|
|
:cond_1
|
|
:goto_0
|
|
iget-object v2, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mContext:Landroid/content/Context;
|
|
|
|
iget v4, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mMenuMaxWidth:I
|
|
|
|
const/4 v5, 0x0
|
|
|
|
invoke-static {v1, v5, v2, v4}, Landroidx/appcompat/view/menu/MenuPopup;->measureIndividualMenuWidth(Landroid/widget/ListAdapter;Landroid/view/ViewGroup;Landroid/content/Context;I)I
|
|
|
|
move-result v2
|
|
|
|
invoke-direct {p0}, Landroidx/appcompat/view/menu/CascadingMenuPopup;->createPopupWindow()Landroidx/appcompat/widget/MenuPopupWindow;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v4, v1}, Landroidx/appcompat/widget/ListPopupWindow;->setAdapter(Landroid/widget/ListAdapter;)V
|
|
|
|
invoke-virtual {v4, v2}, Landroidx/appcompat/widget/ListPopupWindow;->setContentWidth(I)V
|
|
|
|
iget v1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mDropDownGravity:I
|
|
|
|
invoke-virtual {v4, v1}, Landroidx/appcompat/widget/ListPopupWindow;->setDropDownGravity(I)V
|
|
|
|
iget-object v1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v1}, Ljava/util/List;->size()I
|
|
|
|
move-result v1
|
|
|
|
if-lez v1, :cond_2
|
|
|
|
iget-object v1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v1}, Ljava/util/List;->size()I
|
|
|
|
move-result v6
|
|
|
|
sub-int/2addr v6, v3
|
|
|
|
invoke-interface {v1, v6}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;
|
|
|
|
invoke-direct {p0, v1, p1}, Landroidx/appcompat/view/menu/CascadingMenuPopup;->findParentViewForSubmenu(Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;Landroidx/appcompat/view/menu/MenuBuilder;)Landroid/view/View;
|
|
|
|
move-result-object v6
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
move-object v1, v5
|
|
|
|
move-object v6, v1
|
|
|
|
:goto_1
|
|
const/4 v7, 0x0
|
|
|
|
if-eqz v6, :cond_9
|
|
|
|
invoke-virtual {v4, v7}, Landroidx/appcompat/widget/MenuPopupWindow;->setTouchModal(Z)V
|
|
|
|
invoke-virtual {v4, v5}, Landroidx/appcompat/widget/MenuPopupWindow;->setEnterTransition(Ljava/lang/Object;)V
|
|
|
|
invoke-direct {p0, v2}, Landroidx/appcompat/view/menu/CascadingMenuPopup;->getNextMenuPosition(I)I
|
|
|
|
move-result v8
|
|
|
|
if-ne v8, v3, :cond_3
|
|
|
|
const/4 v9, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
const/4 v9, 0x0
|
|
|
|
:goto_2
|
|
iput v8, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mLastPosition:I
|
|
|
|
sget v8, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v10, 0x1a
|
|
|
|
const/4 v11, 0x5
|
|
|
|
if-lt v8, v10, :cond_4
|
|
|
|
invoke-virtual {v4, v6}, Landroidx/appcompat/widget/ListPopupWindow;->setAnchorView(Landroid/view/View;)V
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v10, 0x0
|
|
|
|
goto :goto_3
|
|
|
|
:cond_4
|
|
const/4 v8, 0x2
|
|
|
|
new-array v10, v8, [I
|
|
|
|
iget-object v12, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mAnchorView:Landroid/view/View;
|
|
|
|
invoke-virtual {v12, v10}, Landroid/view/View;->getLocationOnScreen([I)V
|
|
|
|
new-array v8, v8, [I
|
|
|
|
invoke-virtual {v6, v8}, Landroid/view/View;->getLocationOnScreen([I)V
|
|
|
|
iget v12, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mDropDownGravity:I
|
|
|
|
and-int/lit8 v12, v12, 0x7
|
|
|
|
if-ne v12, v11, :cond_5
|
|
|
|
aget v12, v10, v7
|
|
|
|
iget-object v13, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mAnchorView:Landroid/view/View;
|
|
|
|
invoke-virtual {v13}, Landroid/view/View;->getWidth()I
|
|
|
|
move-result v13
|
|
|
|
add-int/2addr v13, v12
|
|
|
|
aput v13, v10, v7
|
|
|
|
aget v12, v8, v7
|
|
|
|
invoke-virtual {v6}, Landroid/view/View;->getWidth()I
|
|
|
|
move-result v13
|
|
|
|
add-int/2addr v13, v12
|
|
|
|
aput v13, v8, v7
|
|
|
|
:cond_5
|
|
aget v12, v8, v7
|
|
|
|
aget v13, v10, v7
|
|
|
|
sub-int/2addr v12, v13
|
|
|
|
aget v8, v8, v3
|
|
|
|
aget v10, v10, v3
|
|
|
|
sub-int/2addr v8, v10
|
|
|
|
move v10, v12
|
|
|
|
:goto_3
|
|
iget v12, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mDropDownGravity:I
|
|
|
|
and-int/2addr v12, v11
|
|
|
|
if-ne v12, v11, :cond_7
|
|
|
|
if-eqz v9, :cond_6
|
|
|
|
add-int/2addr v10, v2
|
|
|
|
goto :goto_5
|
|
|
|
:cond_6
|
|
invoke-virtual {v6}, Landroid/view/View;->getWidth()I
|
|
|
|
move-result v2
|
|
|
|
goto :goto_4
|
|
|
|
:cond_7
|
|
if-eqz v9, :cond_8
|
|
|
|
invoke-virtual {v6}, Landroid/view/View;->getWidth()I
|
|
|
|
move-result v2
|
|
|
|
add-int/2addr v10, v2
|
|
|
|
goto :goto_5
|
|
|
|
:cond_8
|
|
:goto_4
|
|
sub-int/2addr v10, v2
|
|
|
|
:goto_5
|
|
invoke-virtual {v4, v10}, Landroidx/appcompat/widget/ListPopupWindow;->setHorizontalOffset(I)V
|
|
|
|
invoke-virtual {v4, v3}, Landroidx/appcompat/widget/ListPopupWindow;->setOverlapAnchor(Z)V
|
|
|
|
invoke-virtual {v4, v8}, Landroidx/appcompat/widget/ListPopupWindow;->setVerticalOffset(I)V
|
|
|
|
goto :goto_6
|
|
|
|
:cond_9
|
|
iget-boolean v2, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mHasXOffset:Z
|
|
|
|
if-eqz v2, :cond_a
|
|
|
|
iget v2, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mXOffset:I
|
|
|
|
invoke-virtual {v4, v2}, Landroidx/appcompat/widget/ListPopupWindow;->setHorizontalOffset(I)V
|
|
|
|
:cond_a
|
|
iget-boolean v2, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mHasYOffset:Z
|
|
|
|
if-eqz v2, :cond_b
|
|
|
|
iget v2, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mYOffset:I
|
|
|
|
invoke-virtual {v4, v2}, Landroidx/appcompat/widget/ListPopupWindow;->setVerticalOffset(I)V
|
|
|
|
:cond_b
|
|
invoke-virtual {p0}, Landroidx/appcompat/view/menu/MenuPopup;->getEpicenterBounds()Landroid/graphics/Rect;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v4, v2}, Landroidx/appcompat/widget/ListPopupWindow;->setEpicenterBounds(Landroid/graphics/Rect;)V
|
|
|
|
:goto_6
|
|
new-instance v2, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;
|
|
|
|
iget v3, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mLastPosition:I
|
|
|
|
invoke-direct {v2, v4, p1, v3}, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;-><init>(Landroidx/appcompat/widget/MenuPopupWindow;Landroidx/appcompat/view/menu/MenuBuilder;I)V
|
|
|
|
iget-object v3, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v3, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
invoke-virtual {v4}, Landroidx/appcompat/widget/ListPopupWindow;->show()V
|
|
|
|
invoke-virtual {v4}, Landroidx/appcompat/widget/ListPopupWindow;->getListView()Landroid/widget/ListView;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2, p0}, Landroid/widget/ListView;->setOnKeyListener(Landroid/view/View$OnKeyListener;)V
|
|
|
|
if-nez v1, :cond_c
|
|
|
|
iget-boolean v1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowTitle:Z
|
|
|
|
if-eqz v1, :cond_c
|
|
|
|
invoke-virtual {p1}, Landroidx/appcompat/view/menu/MenuBuilder;->getHeaderTitle()Ljava/lang/CharSequence;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_c
|
|
|
|
sget v1, Landroidx/appcompat/R$layout;->abc_popup_menu_header_item_layout:I
|
|
|
|
invoke-virtual {v0, v1, v2, v7}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/widget/FrameLayout;
|
|
|
|
const v1, 0x1020016
|
|
|
|
invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->findViewById(I)Landroid/view/View;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Landroid/widget/TextView;
|
|
|
|
invoke-virtual {v0, v7}, Landroid/widget/FrameLayout;->setEnabled(Z)V
|
|
|
|
invoke-virtual {p1}, Landroidx/appcompat/view/menu/MenuBuilder;->getHeaderTitle()Ljava/lang/CharSequence;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v1, p1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V
|
|
|
|
invoke-virtual {v2, v0, v5, v7}, Landroid/widget/ListView;->addHeaderView(Landroid/view/View;Ljava/lang/Object;Z)V
|
|
|
|
invoke-virtual {v4}, Landroidx/appcompat/widget/ListPopupWindow;->show()V
|
|
|
|
:cond_c
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public addMenu(Landroidx/appcompat/view/menu/MenuBuilder;)V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mContext:Landroid/content/Context;
|
|
|
|
invoke-virtual {p1, p0, v0}, Landroidx/appcompat/view/menu/MenuBuilder;->addMenuPresenter(Landroidx/appcompat/view/menu/MenuPresenter;Landroid/content/Context;)V
|
|
|
|
invoke-virtual {p0}, Landroidx/appcompat/view/menu/CascadingMenuPopup;->isShowing()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-direct {p0, p1}, Landroidx/appcompat/view/menu/CascadingMenuPopup;->showMenu(Landroidx/appcompat/view/menu/MenuBuilder;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mPendingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public closeMenuOnSubMenuOpened()Z
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public dismiss()V
|
|
.locals 4
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
if-lez v0, :cond_1
|
|
|
|
iget-object v1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
new-array v2, v0, [Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;
|
|
|
|
invoke-interface {v1, v2}, Ljava/util/List;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, [Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;
|
|
|
|
add-int/lit8 v0, v0, -0x1
|
|
|
|
:goto_0
|
|
if-ltz v0, :cond_1
|
|
|
|
aget-object v2, v1, v0
|
|
|
|
iget-object v3, v2, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;->window:Landroidx/appcompat/widget/MenuPopupWindow;
|
|
|
|
invoke-virtual {v3}, Landroidx/appcompat/widget/ListPopupWindow;->isShowing()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
iget-object v2, v2, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;->window:Landroidx/appcompat/widget/MenuPopupWindow;
|
|
|
|
invoke-virtual {v2}, Landroidx/appcompat/widget/ListPopupWindow;->dismiss()V
|
|
|
|
:cond_0
|
|
add-int/lit8 v0, v0, -0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public flagActionItems()Z
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getListView()Landroid/widget/ListView;
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
|
|
|
move-result v1
|
|
|
|
add-int/lit8 v1, v1, -0x1
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;
|
|
|
|
invoke-virtual {v0}, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;->getListView()Landroid/widget/ListView;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_0
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public isShowing()Z
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-lez v0, :cond_0
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;
|
|
|
|
iget-object v0, v0, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;->window:Landroidx/appcompat/widget/MenuPopupWindow;
|
|
|
|
invoke-virtual {v0}, Landroidx/appcompat/widget/ListPopupWindow;->isShowing()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
:cond_0
|
|
return v1
|
|
.end method
|
|
|
|
.method public onCloseMenu(Landroidx/appcompat/view/menu/MenuBuilder;Z)V
|
|
.locals 5
|
|
|
|
invoke-direct {p0, p1}, Landroidx/appcompat/view/menu/CascadingMenuPopup;->findIndexOfAddedMenu(Landroidx/appcompat/view/menu/MenuBuilder;)I
|
|
|
|
move-result v0
|
|
|
|
if-gez v0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
add-int/lit8 v1, v0, 0x1
|
|
|
|
iget-object v2, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v2}, Ljava/util/List;->size()I
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-ge v1, v2, :cond_1
|
|
|
|
iget-object v2, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v2, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;
|
|
|
|
iget-object v1, v1, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
invoke-virtual {v1, v3}, Landroidx/appcompat/view/menu/MenuBuilder;->close(Z)V
|
|
|
|
:cond_1
|
|
iget-object v1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v1, v0}, Ljava/util/List;->remove(I)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;
|
|
|
|
iget-object v1, v0, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
invoke-virtual {v1, p0}, Landroidx/appcompat/view/menu/MenuBuilder;->removeMenuPresenter(Landroidx/appcompat/view/menu/MenuPresenter;)V
|
|
|
|
iget-boolean v1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShouldCloseImmediately:Z
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
iget-object v1, v0, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;->window:Landroidx/appcompat/widget/MenuPopupWindow;
|
|
|
|
invoke-virtual {v1, v2}, Landroidx/appcompat/widget/MenuPopupWindow;->setExitTransition(Ljava/lang/Object;)V
|
|
|
|
iget-object v1, v0, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;->window:Landroidx/appcompat/widget/MenuPopupWindow;
|
|
|
|
invoke-virtual {v1, v3}, Landroidx/appcompat/widget/ListPopupWindow;->setAnimationStyle(I)V
|
|
|
|
:cond_2
|
|
iget-object v0, v0, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;->window:Landroidx/appcompat/widget/MenuPopupWindow;
|
|
|
|
invoke-virtual {v0}, Landroidx/appcompat/widget/ListPopupWindow;->dismiss()V
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
if-lez v0, :cond_3
|
|
|
|
iget-object v1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
add-int/lit8 v4, v0, -0x1
|
|
|
|
invoke-interface {v1, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;
|
|
|
|
iget v1, v1, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;->position:I
|
|
|
|
iput v1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mLastPosition:I
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
invoke-direct {p0}, Landroidx/appcompat/view/menu/CascadingMenuPopup;->getInitialMenuPosition()I
|
|
|
|
move-result v1
|
|
|
|
iput v1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mLastPosition:I
|
|
|
|
:goto_0
|
|
if-nez v0, :cond_7
|
|
|
|
invoke-virtual {p0}, Landroidx/appcompat/view/menu/CascadingMenuPopup;->dismiss()V
|
|
|
|
iget-object p2, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mPresenterCallback:Landroidx/appcompat/view/menu/MenuPresenter$Callback;
|
|
|
|
if-eqz p2, :cond_4
|
|
|
|
const/4 v0, 0x1
|
|
|
|
invoke-interface {p2, p1, v0}, Landroidx/appcompat/view/menu/MenuPresenter$Callback;->onCloseMenu(Landroidx/appcompat/view/menu/MenuBuilder;Z)V
|
|
|
|
:cond_4
|
|
iget-object p1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mTreeObserver:Landroid/view/ViewTreeObserver;
|
|
|
|
if-eqz p1, :cond_6
|
|
|
|
invoke-virtual {p1}, Landroid/view/ViewTreeObserver;->isAlive()Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_5
|
|
|
|
iget-object p1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mTreeObserver:Landroid/view/ViewTreeObserver;
|
|
|
|
iget-object p2, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mGlobalLayoutListener:Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;
|
|
|
|
invoke-virtual {p1, p2}, Landroid/view/ViewTreeObserver;->removeGlobalOnLayoutListener(Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V
|
|
|
|
:cond_5
|
|
iput-object v2, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mTreeObserver:Landroid/view/ViewTreeObserver;
|
|
|
|
:cond_6
|
|
iget-object p1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShownAnchorView:Landroid/view/View;
|
|
|
|
iget-object p2, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mAttachStateChangeListener:Landroid/view/View$OnAttachStateChangeListener;
|
|
|
|
invoke-virtual {p1, p2}, Landroid/view/View;->removeOnAttachStateChangeListener(Landroid/view/View$OnAttachStateChangeListener;)V
|
|
|
|
iget-object p1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mOnDismissListener:Landroid/widget/PopupWindow$OnDismissListener;
|
|
|
|
invoke-interface {p1}, Landroid/widget/PopupWindow$OnDismissListener;->onDismiss()V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_7
|
|
if-eqz p2, :cond_8
|
|
|
|
iget-object p1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {p1, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;
|
|
|
|
iget-object p1, p1, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
invoke-virtual {p1, v3}, Landroidx/appcompat/view/menu/MenuBuilder;->close(Z)V
|
|
|
|
:cond_8
|
|
:goto_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public onDismiss()V
|
|
.locals 5
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->size()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v0, :cond_1
|
|
|
|
iget-object v3, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v3, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;
|
|
|
|
iget-object v4, v3, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;->window:Landroidx/appcompat/widget/MenuPopupWindow;
|
|
|
|
invoke-virtual {v4}, Landroidx/appcompat/widget/ListPopupWindow;->isShowing()Z
|
|
|
|
move-result v4
|
|
|
|
if-nez v4, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 v3, 0x0
|
|
|
|
:goto_1
|
|
if-eqz v3, :cond_2
|
|
|
|
iget-object v0, v3, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
invoke-virtual {v0, v1}, Landroidx/appcompat/view/menu/MenuBuilder;->close(Z)V
|
|
|
|
:cond_2
|
|
return-void
|
|
.end method
|
|
|
|
.method public onKey(Landroid/view/View;ILandroid/view/KeyEvent;)Z
|
|
.locals 0
|
|
|
|
invoke-virtual {p3}, Landroid/view/KeyEvent;->getAction()I
|
|
|
|
move-result p1
|
|
|
|
const/4 p3, 0x1
|
|
|
|
if-ne p1, p3, :cond_0
|
|
|
|
const/16 p1, 0x52
|
|
|
|
if-ne p2, p1, :cond_0
|
|
|
|
invoke-virtual {p0}, Landroidx/appcompat/view/menu/CascadingMenuPopup;->dismiss()V
|
|
|
|
return p3
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public onRestoreInstanceState(Landroid/os/Parcelable;)V
|
|
.locals 0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onSaveInstanceState()Landroid/os/Parcelable;
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public onSubMenuSelected(Landroidx/appcompat/view/menu/SubMenuBuilder;)Z
|
|
.locals 4
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_0
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;
|
|
|
|
iget-object v3, v1, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;->menu:Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
if-ne p1, v3, :cond_0
|
|
|
|
invoke-virtual {v1}, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;->getListView()Landroid/widget/ListView;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Landroid/widget/ListView;->requestFocus()Z
|
|
|
|
return v2
|
|
|
|
:cond_1
|
|
invoke-virtual {p1}, Landroidx/appcompat/view/menu/MenuBuilder;->hasVisibleItems()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
invoke-virtual {p0, p1}, Landroidx/appcompat/view/menu/CascadingMenuPopup;->addMenu(Landroidx/appcompat/view/menu/MenuBuilder;)V
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mPresenterCallback:Landroidx/appcompat/view/menu/MenuPresenter$Callback;
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
invoke-interface {v0, p1}, Landroidx/appcompat/view/menu/MenuPresenter$Callback;->onOpenSubMenu(Landroidx/appcompat/view/menu/MenuBuilder;)Z
|
|
|
|
:cond_2
|
|
return v2
|
|
|
|
:cond_3
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public setAnchorView(Landroid/view/View;)V
|
|
.locals 1
|
|
.param p1 # Landroid/view/View;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mAnchorView:Landroid/view/View;
|
|
|
|
if-eq v0, p1, :cond_0
|
|
|
|
iput-object p1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mAnchorView:Landroid/view/View;
|
|
|
|
iget p1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mRawDropDownGravity:I
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mAnchorView:Landroid/view/View;
|
|
|
|
invoke-static {v0}, Landroidx/core/view/ViewCompat;->getLayoutDirection(Landroid/view/View;)I
|
|
|
|
move-result v0
|
|
|
|
invoke-static {p1, v0}, Landroidx/core/view/GravityCompat;->getAbsoluteGravity(II)I
|
|
|
|
move-result p1
|
|
|
|
iput p1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mDropDownGravity:I
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public setCallback(Landroidx/appcompat/view/menu/MenuPresenter$Callback;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mPresenterCallback:Landroidx/appcompat/view/menu/MenuPresenter$Callback;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setForceShowIcon(Z)V
|
|
.locals 0
|
|
|
|
iput-boolean p1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mForceShowIcon:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setGravity(I)V
|
|
.locals 1
|
|
|
|
iget v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mRawDropDownGravity:I
|
|
|
|
if-eq v0, p1, :cond_0
|
|
|
|
iput p1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mRawDropDownGravity:I
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mAnchorView:Landroid/view/View;
|
|
|
|
invoke-static {v0}, Landroidx/core/view/ViewCompat;->getLayoutDirection(Landroid/view/View;)I
|
|
|
|
move-result v0
|
|
|
|
invoke-static {p1, v0}, Landroidx/core/view/GravityCompat;->getAbsoluteGravity(II)I
|
|
|
|
move-result p1
|
|
|
|
iput p1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mDropDownGravity:I
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public setHorizontalOffset(I)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
iput-boolean v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mHasXOffset:Z
|
|
|
|
iput p1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mXOffset:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setOnDismissListener(Landroid/widget/PopupWindow$OnDismissListener;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mOnDismissListener:Landroid/widget/PopupWindow$OnDismissListener;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setShowTitle(Z)V
|
|
.locals 0
|
|
|
|
iput-boolean p1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowTitle:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setVerticalOffset(I)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
iput-boolean v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mHasYOffset:Z
|
|
|
|
iput p1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mYOffset:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public show()V
|
|
.locals 2
|
|
|
|
invoke-virtual {p0}, Landroidx/appcompat/view/menu/CascadingMenuPopup;->isShowing()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mPendingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_0
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Landroidx/appcompat/view/menu/MenuBuilder;
|
|
|
|
invoke-direct {p0, v1}, Landroidx/appcompat/view/menu/CascadingMenuPopup;->showMenu(Landroidx/appcompat/view/menu/MenuBuilder;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mPendingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->clear()V
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mAnchorView:Landroid/view/View;
|
|
|
|
iput-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShownAnchorView:Landroid/view/View;
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShownAnchorView:Landroid/view/View;
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mTreeObserver:Landroid/view/ViewTreeObserver;
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
const/4 v0, 0x0
|
|
|
|
:goto_1
|
|
iget-object v1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShownAnchorView:Landroid/view/View;
|
|
|
|
invoke-virtual {v1}, Landroid/view/View;->getViewTreeObserver()Landroid/view/ViewTreeObserver;
|
|
|
|
move-result-object v1
|
|
|
|
iput-object v1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mTreeObserver:Landroid/view/ViewTreeObserver;
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mTreeObserver:Landroid/view/ViewTreeObserver;
|
|
|
|
iget-object v1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mGlobalLayoutListener:Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/view/ViewTreeObserver;->addOnGlobalLayoutListener(Landroid/view/ViewTreeObserver$OnGlobalLayoutListener;)V
|
|
|
|
:cond_3
|
|
iget-object v0, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShownAnchorView:Landroid/view/View;
|
|
|
|
iget-object v1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mAttachStateChangeListener:Landroid/view/View$OnAttachStateChangeListener;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/view/View;->addOnAttachStateChangeListener(Landroid/view/View$OnAttachStateChangeListener;)V
|
|
|
|
:cond_4
|
|
return-void
|
|
.end method
|
|
|
|
.method public updateMenuView(Z)V
|
|
.locals 1
|
|
|
|
iget-object p1, p0, Landroidx/appcompat/view/menu/CascadingMenuPopup;->mShowingMenus:Ljava/util/List;
|
|
|
|
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_0
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;
|
|
|
|
invoke-virtual {v0}, Landroidx/appcompat/view/menu/CascadingMenuPopup$CascadingMenuInfo;->getListView()Landroid/widget/ListView;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Landroid/widget/ListView;->getAdapter()Landroid/widget/ListAdapter;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Landroidx/appcompat/view/menu/MenuPopup;->toMenuAdapter(Landroid/widget/ListAdapter;)Landroidx/appcompat/view/menu/MenuAdapter;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Landroidx/appcompat/view/menu/MenuAdapter;->notifyDataSetChanged()V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|