507 lines
16 KiB
Smali
507 lines
16 KiB
Smali
.class public Landroid/support/v7/view/menu/ListMenuPresenter;
|
|
.super Ljava/lang/Object;
|
|
.source "ListMenuPresenter.java"
|
|
|
|
# interfaces
|
|
.implements Landroid/support/v7/view/menu/MenuPresenter;
|
|
.implements Landroid/widget/AdapterView$OnItemClickListener;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Landroid/support/v7/view/menu/ListMenuPresenter$MenuAdapter;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final TAG:Ljava/lang/String; = "ListMenuPresenter"
|
|
|
|
.field public static final VIEWS_TAG:Ljava/lang/String; = "android:menu:list"
|
|
|
|
|
|
# instance fields
|
|
.field mAdapter:Landroid/support/v7/view/menu/ListMenuPresenter$MenuAdapter;
|
|
|
|
.field private mCallback:Landroid/support/v7/view/menu/MenuPresenter$Callback;
|
|
|
|
.field mContext:Landroid/content/Context;
|
|
|
|
.field private mId:I
|
|
|
|
.field mInflater:Landroid/view/LayoutInflater;
|
|
|
|
.field private mItemIndexOffset:I
|
|
|
|
.field mItemLayoutRes:I
|
|
|
|
.field mMenu:Landroid/support/v7/view/menu/MenuBuilder;
|
|
|
|
.field mMenuView:Landroid/support/v7/view/menu/ExpandedMenuView;
|
|
|
|
.field mThemeRes:I
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(II)V
|
|
.locals 0
|
|
.param p1, "itemLayoutRes" # I
|
|
.param p2, "themeRes" # I
|
|
|
|
.prologue
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput p1, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mItemLayoutRes:I
|
|
|
|
iput p2, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mThemeRes:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;I)V
|
|
.locals 1
|
|
.param p1, "context" # Landroid/content/Context;
|
|
.param p2, "itemLayoutRes" # I
|
|
|
|
.prologue
|
|
const/4 v0, 0x0
|
|
|
|
invoke-direct {p0, p2, v0}, Landroid/support/v7/view/menu/ListMenuPresenter;-><init>(II)V
|
|
|
|
iput-object p1, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mContext:Landroid/content/Context;
|
|
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mContext:Landroid/content/Context;
|
|
|
|
invoke-static {v0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mInflater:Landroid/view/LayoutInflater;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static synthetic access$000(Landroid/support/v7/view/menu/ListMenuPresenter;)I
|
|
.locals 1
|
|
.param p0, "x0" # Landroid/support/v7/view/menu/ListMenuPresenter;
|
|
|
|
.prologue
|
|
iget v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mItemIndexOffset:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public collapseItemActionView(Landroid/support/v7/view/menu/MenuBuilder;Landroid/support/v7/view/menu/MenuItemImpl;)Z
|
|
.locals 1
|
|
.param p1, "menu" # Landroid/support/v7/view/menu/MenuBuilder;
|
|
.param p2, "item" # Landroid/support/v7/view/menu/MenuItemImpl;
|
|
|
|
.prologue
|
|
const/4 v0, 0x0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public expandItemActionView(Landroid/support/v7/view/menu/MenuBuilder;Landroid/support/v7/view/menu/MenuItemImpl;)Z
|
|
.locals 1
|
|
.param p1, "menu" # Landroid/support/v7/view/menu/MenuBuilder;
|
|
.param p2, "item" # Landroid/support/v7/view/menu/MenuItemImpl;
|
|
|
|
.prologue
|
|
const/4 v0, 0x0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public flagActionItems()Z
|
|
.locals 1
|
|
|
|
.prologue
|
|
const/4 v0, 0x0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getAdapter()Landroid/widget/ListAdapter;
|
|
.locals 1
|
|
|
|
.prologue
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mAdapter:Landroid/support/v7/view/menu/ListMenuPresenter$MenuAdapter;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
new-instance v0, Landroid/support/v7/view/menu/ListMenuPresenter$MenuAdapter;
|
|
|
|
invoke-direct {v0, p0}, Landroid/support/v7/view/menu/ListMenuPresenter$MenuAdapter;-><init>(Landroid/support/v7/view/menu/ListMenuPresenter;)V
|
|
|
|
iput-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mAdapter:Landroid/support/v7/view/menu/ListMenuPresenter$MenuAdapter;
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mAdapter:Landroid/support/v7/view/menu/ListMenuPresenter$MenuAdapter;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getId()I
|
|
.locals 1
|
|
|
|
.prologue
|
|
iget v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mId:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method getItemIndexOffset()I
|
|
.locals 1
|
|
|
|
.prologue
|
|
iget v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mItemIndexOffset:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getMenuView(Landroid/view/ViewGroup;)Landroid/support/v7/view/menu/MenuView;
|
|
.locals 3
|
|
.param p1, "root" # Landroid/view/ViewGroup;
|
|
|
|
.prologue
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mMenuView:Landroid/support/v7/view/menu/ExpandedMenuView;
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mInflater:Landroid/view/LayoutInflater;
|
|
|
|
sget v1, Landroid/support/v7/appcompat/R$layout;->abc_expanded_menu_layout:I
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-virtual {v0, v1, p1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/support/v7/view/menu/ExpandedMenuView;
|
|
|
|
iput-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mMenuView:Landroid/support/v7/view/menu/ExpandedMenuView;
|
|
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mAdapter:Landroid/support/v7/view/menu/ListMenuPresenter$MenuAdapter;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
new-instance v0, Landroid/support/v7/view/menu/ListMenuPresenter$MenuAdapter;
|
|
|
|
invoke-direct {v0, p0}, Landroid/support/v7/view/menu/ListMenuPresenter$MenuAdapter;-><init>(Landroid/support/v7/view/menu/ListMenuPresenter;)V
|
|
|
|
iput-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mAdapter:Landroid/support/v7/view/menu/ListMenuPresenter$MenuAdapter;
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mMenuView:Landroid/support/v7/view/menu/ExpandedMenuView;
|
|
|
|
iget-object v1, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mAdapter:Landroid/support/v7/view/menu/ListMenuPresenter$MenuAdapter;
|
|
|
|
invoke-virtual {v0, v1}, Landroid/support/v7/view/menu/ExpandedMenuView;->setAdapter(Landroid/widget/ListAdapter;)V
|
|
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mMenuView:Landroid/support/v7/view/menu/ExpandedMenuView;
|
|
|
|
invoke-virtual {v0, p0}, Landroid/support/v7/view/menu/ExpandedMenuView;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V
|
|
|
|
:cond_1
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mMenuView:Landroid/support/v7/view/menu/ExpandedMenuView;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public initForMenu(Landroid/content/Context;Landroid/support/v7/view/menu/MenuBuilder;)V
|
|
.locals 2
|
|
.param p1, "context" # Landroid/content/Context;
|
|
.param p2, "menu" # Landroid/support/v7/view/menu/MenuBuilder;
|
|
|
|
.prologue
|
|
iget v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mThemeRes:I
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
new-instance v0, Landroid/view/ContextThemeWrapper;
|
|
|
|
iget v1, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mThemeRes:I
|
|
|
|
invoke-direct {v0, p1, v1}, Landroid/view/ContextThemeWrapper;-><init>(Landroid/content/Context;I)V
|
|
|
|
iput-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mContext:Landroid/content/Context;
|
|
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mContext:Landroid/content/Context;
|
|
|
|
invoke-static {v0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mInflater:Landroid/view/LayoutInflater;
|
|
|
|
:cond_0
|
|
:goto_0
|
|
iput-object p2, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mMenu:Landroid/support/v7/view/menu/MenuBuilder;
|
|
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mAdapter:Landroid/support/v7/view/menu/ListMenuPresenter$MenuAdapter;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mAdapter:Landroid/support/v7/view/menu/ListMenuPresenter$MenuAdapter;
|
|
|
|
invoke-virtual {v0}, Landroid/support/v7/view/menu/ListMenuPresenter$MenuAdapter;->notifyDataSetChanged()V
|
|
|
|
:cond_1
|
|
return-void
|
|
|
|
:cond_2
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mContext:Landroid/content/Context;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iput-object p1, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mContext:Landroid/content/Context;
|
|
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mInflater:Landroid/view/LayoutInflater;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mContext:Landroid/content/Context;
|
|
|
|
invoke-static {v0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mInflater:Landroid/view/LayoutInflater;
|
|
|
|
goto :goto_0
|
|
.end method
|
|
|
|
.method public onCloseMenu(Landroid/support/v7/view/menu/MenuBuilder;Z)V
|
|
.locals 1
|
|
.param p1, "menu" # Landroid/support/v7/view/menu/MenuBuilder;
|
|
.param p2, "allMenusAreClosing" # Z
|
|
|
|
.prologue
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mCallback:Landroid/support/v7/view/menu/MenuPresenter$Callback;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mCallback:Landroid/support/v7/view/menu/MenuPresenter$Callback;
|
|
|
|
invoke-interface {v0, p1, p2}, Landroid/support/v7/view/menu/MenuPresenter$Callback;->onCloseMenu(Landroid/support/v7/view/menu/MenuBuilder;Z)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public onItemClick(Landroid/widget/AdapterView;Landroid/view/View;IJ)V
|
|
.locals 3
|
|
.param p2, "view" # Landroid/view/View;
|
|
.param p3, "position" # I
|
|
.param p4, "id" # J
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Landroid/widget/AdapterView",
|
|
"<*>;",
|
|
"Landroid/view/View;",
|
|
"IJ)V"
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
.local p1, "parent":Landroid/widget/AdapterView;, "Landroid/widget/AdapterView<*>;"
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mMenu:Landroid/support/v7/view/menu/MenuBuilder;
|
|
|
|
iget-object v1, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mAdapter:Landroid/support/v7/view/menu/ListMenuPresenter$MenuAdapter;
|
|
|
|
invoke-virtual {v1, p3}, Landroid/support/v7/view/menu/ListMenuPresenter$MenuAdapter;->getItem(I)Landroid/support/v7/view/menu/MenuItemImpl;
|
|
|
|
move-result-object v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-virtual {v0, v1, p0, v2}, Landroid/support/v7/view/menu/MenuBuilder;->performItemAction(Landroid/view/MenuItem;Landroid/support/v7/view/menu/MenuPresenter;I)Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onRestoreInstanceState(Landroid/os/Parcelable;)V
|
|
.locals 0
|
|
.param p1, "state" # Landroid/os/Parcelable;
|
|
|
|
.prologue
|
|
check-cast p1, Landroid/os/Bundle;
|
|
|
|
.end local p1 # "state":Landroid/os/Parcelable;
|
|
invoke-virtual {p0, p1}, Landroid/support/v7/view/menu/ListMenuPresenter;->restoreHierarchyState(Landroid/os/Bundle;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onSaveInstanceState()Landroid/os/Parcelable;
|
|
.locals 2
|
|
|
|
.prologue
|
|
iget-object v1, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mMenuView:Landroid/support/v7/view/menu/ExpandedMenuView;
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return-object v0
|
|
|
|
:cond_0
|
|
new-instance v0, Landroid/os/Bundle;
|
|
|
|
invoke-direct {v0}, Landroid/os/Bundle;-><init>()V
|
|
|
|
.local v0, "state":Landroid/os/Bundle;
|
|
invoke-virtual {p0, v0}, Landroid/support/v7/view/menu/ListMenuPresenter;->saveHierarchyState(Landroid/os/Bundle;)V
|
|
|
|
goto :goto_0
|
|
.end method
|
|
|
|
.method public onSubMenuSelected(Landroid/support/v7/view/menu/SubMenuBuilder;)Z
|
|
.locals 2
|
|
.param p1, "subMenu" # Landroid/support/v7/view/menu/SubMenuBuilder;
|
|
|
|
.prologue
|
|
invoke-virtual {p1}, Landroid/support/v7/view/menu/SubMenuBuilder;->hasVisibleItems()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
return v0
|
|
|
|
:cond_0
|
|
new-instance v0, Landroid/support/v7/view/menu/MenuDialogHelper;
|
|
|
|
invoke-direct {v0, p1}, Landroid/support/v7/view/menu/MenuDialogHelper;-><init>(Landroid/support/v7/view/menu/MenuBuilder;)V
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {v0, v1}, Landroid/support/v7/view/menu/MenuDialogHelper;->show(Landroid/os/IBinder;)V
|
|
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mCallback:Landroid/support/v7/view/menu/MenuPresenter$Callback;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mCallback:Landroid/support/v7/view/menu/MenuPresenter$Callback;
|
|
|
|
invoke-interface {v0, p1}, Landroid/support/v7/view/menu/MenuPresenter$Callback;->onOpenSubMenu(Landroid/support/v7/view/menu/MenuBuilder;)Z
|
|
|
|
:cond_1
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
.end method
|
|
|
|
.method public restoreHierarchyState(Landroid/os/Bundle;)V
|
|
.locals 2
|
|
.param p1, "inState" # Landroid/os/Bundle;
|
|
|
|
.prologue
|
|
const-string v1, "android:menu:list"
|
|
|
|
invoke-virtual {p1, v1}, Landroid/os/Bundle;->getSparseParcelableArray(Ljava/lang/String;)Landroid/util/SparseArray;
|
|
|
|
move-result-object v0
|
|
|
|
.local v0, "viewStates":Landroid/util/SparseArray;, "Landroid/util/SparseArray<Landroid/os/Parcelable;>;"
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v1, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mMenuView:Landroid/support/v7/view/menu/ExpandedMenuView;
|
|
|
|
invoke-virtual {v1, v0}, Landroid/view/View;->restoreHierarchyState(Landroid/util/SparseArray;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public saveHierarchyState(Landroid/os/Bundle;)V
|
|
.locals 2
|
|
.param p1, "outState" # Landroid/os/Bundle;
|
|
|
|
.prologue
|
|
new-instance v0, Landroid/util/SparseArray;
|
|
|
|
invoke-direct {v0}, Landroid/util/SparseArray;-><init>()V
|
|
|
|
.local v0, "viewStates":Landroid/util/SparseArray;, "Landroid/util/SparseArray<Landroid/os/Parcelable;>;"
|
|
iget-object v1, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mMenuView:Landroid/support/v7/view/menu/ExpandedMenuView;
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
iget-object v1, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mMenuView:Landroid/support/v7/view/menu/ExpandedMenuView;
|
|
|
|
invoke-virtual {v1, v0}, Landroid/view/View;->saveHierarchyState(Landroid/util/SparseArray;)V
|
|
|
|
:cond_0
|
|
const-string v1, "android:menu:list"
|
|
|
|
invoke-virtual {p1, v1, v0}, Landroid/os/Bundle;->putSparseParcelableArray(Ljava/lang/String;Landroid/util/SparseArray;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setCallback(Landroid/support/v7/view/menu/MenuPresenter$Callback;)V
|
|
.locals 0
|
|
.param p1, "cb" # Landroid/support/v7/view/menu/MenuPresenter$Callback;
|
|
|
|
.prologue
|
|
iput-object p1, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mCallback:Landroid/support/v7/view/menu/MenuPresenter$Callback;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setId(I)V
|
|
.locals 0
|
|
.param p1, "id" # I
|
|
|
|
.prologue
|
|
iput p1, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mId:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public setItemIndexOffset(I)V
|
|
.locals 1
|
|
.param p1, "offset" # I
|
|
|
|
.prologue
|
|
iput p1, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mItemIndexOffset:I
|
|
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mMenuView:Landroid/support/v7/view/menu/ExpandedMenuView;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-virtual {p0, v0}, Landroid/support/v7/view/menu/ListMenuPresenter;->updateMenuView(Z)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public updateMenuView(Z)V
|
|
.locals 1
|
|
.param p1, "cleared" # Z
|
|
|
|
.prologue
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mAdapter:Landroid/support/v7/view/menu/ListMenuPresenter$MenuAdapter;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/ListMenuPresenter;->mAdapter:Landroid/support/v7/view/menu/ListMenuPresenter$MenuAdapter;
|
|
|
|
invoke-virtual {v0}, Landroid/support/v7/view/menu/ListMenuPresenter$MenuAdapter;->notifyDataSetChanged()V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|