470 lines
15 KiB
Smali
470 lines
15 KiB
Smali
.class public abstract Landroid/support/v7/view/menu/BaseMenuPresenter;
|
|
.super Ljava/lang/Object;
|
|
.source "BaseMenuPresenter.java"
|
|
|
|
# interfaces
|
|
.implements Landroid/support/v7/view/menu/MenuPresenter;
|
|
|
|
|
|
# instance fields
|
|
.field private mCallback:Landroid/support/v7/view/menu/MenuPresenter$Callback;
|
|
|
|
.field protected mContext:Landroid/content/Context;
|
|
|
|
.field private mId:I
|
|
|
|
.field protected mInflater:Landroid/view/LayoutInflater;
|
|
|
|
.field private mItemLayoutRes:I
|
|
|
|
.field protected mMenu:Landroid/support/v7/view/menu/MenuBuilder;
|
|
|
|
.field private mMenuLayoutRes:I
|
|
|
|
.field protected mMenuView:Landroid/support/v7/view/menu/MenuView;
|
|
|
|
.field protected mSystemContext:Landroid/content/Context;
|
|
|
|
.field protected mSystemInflater:Landroid/view/LayoutInflater;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Context;II)V
|
|
.locals 1
|
|
.param p1, "context" # Landroid/content/Context;
|
|
.param p2, "menuLayoutRes" # I
|
|
.param p3, "itemLayoutRes" # I
|
|
|
|
.prologue
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mSystemContext:Landroid/content/Context;
|
|
|
|
invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mSystemInflater:Landroid/view/LayoutInflater;
|
|
|
|
iput p2, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mMenuLayoutRes:I
|
|
|
|
iput p3, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mItemLayoutRes:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method protected addItemView(Landroid/view/View;I)V
|
|
.locals 2
|
|
.param p1, "itemView" # Landroid/view/View;
|
|
.param p2, "childIndex" # I
|
|
|
|
.prologue
|
|
invoke-virtual {p1}, Landroid/view/View;->getParent()Landroid/view/ViewParent;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Landroid/view/ViewGroup;
|
|
|
|
.local v0, "currentParent":Landroid/view/ViewGroup;
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0, p1}, Landroid/view/ViewGroup;->removeView(Landroid/view/View;)V
|
|
|
|
:cond_0
|
|
iget-object v1, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mMenuView:Landroid/support/v7/view/menu/MenuView;
|
|
|
|
check-cast v1, Landroid/view/ViewGroup;
|
|
|
|
invoke-virtual {v1, p1, p2}, Landroid/view/ViewGroup;->addView(Landroid/view/View;I)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public abstract bindItemView(Landroid/support/v7/view/menu/MenuItemImpl;Landroid/support/v7/view/menu/MenuView$ItemView;)V
|
|
.end method
|
|
|
|
.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 createItemView(Landroid/view/ViewGroup;)Landroid/support/v7/view/menu/MenuView$ItemView;
|
|
.locals 3
|
|
.param p1, "parent" # Landroid/view/ViewGroup;
|
|
|
|
.prologue
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mSystemInflater:Landroid/view/LayoutInflater;
|
|
|
|
iget v1, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mItemLayoutRes: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/MenuView$ItemView;
|
|
|
|
return-object 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 protected filterLeftoverView(Landroid/view/ViewGroup;I)Z
|
|
.locals 1
|
|
.param p1, "parent" # Landroid/view/ViewGroup;
|
|
.param p2, "childIndex" # I
|
|
|
|
.prologue
|
|
invoke-virtual {p1, p2}, Landroid/view/ViewGroup;->removeViewAt(I)V
|
|
|
|
const/4 v0, 0x1
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public flagActionItems()Z
|
|
.locals 1
|
|
|
|
.prologue
|
|
const/4 v0, 0x0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getCallback()Landroid/support/v7/view/menu/MenuPresenter$Callback;
|
|
.locals 1
|
|
|
|
.prologue
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mCallback:Landroid/support/v7/view/menu/MenuPresenter$Callback;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public getId()I
|
|
.locals 1
|
|
|
|
.prologue
|
|
iget v0, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mId:I
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public getItemView(Landroid/support/v7/view/menu/MenuItemImpl;Landroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
|
|
.locals 2
|
|
.param p1, "item" # Landroid/support/v7/view/menu/MenuItemImpl;
|
|
.param p2, "convertView" # Landroid/view/View;
|
|
.param p3, "parent" # Landroid/view/ViewGroup;
|
|
|
|
.prologue
|
|
instance-of v1, p2, Landroid/support/v7/view/menu/MenuView$ItemView;
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
move-object v0, p2
|
|
|
|
check-cast v0, Landroid/support/v7/view/menu/MenuView$ItemView;
|
|
|
|
.local v0, "itemView":Landroid/support/v7/view/menu/MenuView$ItemView;
|
|
:goto_0
|
|
invoke-virtual {p0, p1, v0}, Landroid/support/v7/view/menu/BaseMenuPresenter;->bindItemView(Landroid/support/v7/view/menu/MenuItemImpl;Landroid/support/v7/view/menu/MenuView$ItemView;)V
|
|
|
|
check-cast v0, Landroid/view/View;
|
|
|
|
.end local v0 # "itemView":Landroid/support/v7/view/menu/MenuView$ItemView;
|
|
return-object v0
|
|
|
|
:cond_0
|
|
invoke-virtual {p0, p3}, Landroid/support/v7/view/menu/BaseMenuPresenter;->createItemView(Landroid/view/ViewGroup;)Landroid/support/v7/view/menu/MenuView$ItemView;
|
|
|
|
move-result-object v0
|
|
|
|
.restart local v0 # "itemView":Landroid/support/v7/view/menu/MenuView$ItemView;
|
|
goto :goto_0
|
|
.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/BaseMenuPresenter;->mMenuView:Landroid/support/v7/view/menu/MenuView;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mSystemInflater:Landroid/view/LayoutInflater;
|
|
|
|
iget v1, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mMenuLayoutRes: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/MenuView;
|
|
|
|
iput-object v0, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mMenuView:Landroid/support/v7/view/menu/MenuView;
|
|
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mMenuView:Landroid/support/v7/view/menu/MenuView;
|
|
|
|
iget-object v1, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mMenu:Landroid/support/v7/view/menu/MenuBuilder;
|
|
|
|
invoke-interface {v0, v1}, Landroid/support/v7/view/menu/MenuView;->initialize(Landroid/support/v7/view/menu/MenuBuilder;)V
|
|
|
|
const/4 v0, 0x1
|
|
|
|
invoke-virtual {p0, v0}, Landroid/support/v7/view/menu/BaseMenuPresenter;->updateMenuView(Z)V
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mMenuView:Landroid/support/v7/view/menu/MenuView;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public initForMenu(Landroid/content/Context;Landroid/support/v7/view/menu/MenuBuilder;)V
|
|
.locals 1
|
|
.param p1, "context" # Landroid/content/Context;
|
|
.param p2, "menu" # Landroid/support/v7/view/menu/MenuBuilder;
|
|
|
|
.prologue
|
|
iput-object p1, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mContext:Landroid/content/Context;
|
|
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->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/BaseMenuPresenter;->mInflater:Landroid/view/LayoutInflater;
|
|
|
|
iput-object p2, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mMenu:Landroid/support/v7/view/menu/MenuBuilder;
|
|
|
|
return-void
|
|
.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/BaseMenuPresenter;->mCallback:Landroid/support/v7/view/menu/MenuPresenter$Callback;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->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 onSubMenuSelected(Landroid/support/v7/view/menu/SubMenuBuilder;)Z
|
|
.locals 1
|
|
.param p1, "menu" # Landroid/support/v7/view/menu/SubMenuBuilder;
|
|
|
|
.prologue
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mCallback:Landroid/support/v7/view/menu/MenuPresenter$Callback;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->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
|
|
|
|
move-result v0
|
|
|
|
:goto_0
|
|
return v0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
goto :goto_0
|
|
.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/BaseMenuPresenter;->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/BaseMenuPresenter;->mId:I
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public shouldIncludeItem(ILandroid/support/v7/view/menu/MenuItemImpl;)Z
|
|
.locals 1
|
|
.param p1, "childIndex" # I
|
|
.param p2, "item" # Landroid/support/v7/view/menu/MenuItemImpl;
|
|
|
|
.prologue
|
|
const/4 v0, 0x1
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public updateMenuView(Z)V
|
|
.locals 10
|
|
.param p1, "cleared" # Z
|
|
|
|
.prologue
|
|
iget-object v7, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mMenuView:Landroid/support/v7/view/menu/MenuView;
|
|
|
|
check-cast v7, Landroid/view/ViewGroup;
|
|
|
|
.local v7, "parent":Landroid/view/ViewGroup;
|
|
if-nez v7, :cond_1
|
|
|
|
:cond_0
|
|
return-void
|
|
|
|
:cond_1
|
|
const/4 v0, 0x0
|
|
|
|
.local v0, "childIndex":I
|
|
iget-object v9, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mMenu:Landroid/support/v7/view/menu/MenuBuilder;
|
|
|
|
if-eqz v9, :cond_6
|
|
|
|
iget-object v9, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mMenu:Landroid/support/v7/view/menu/MenuBuilder;
|
|
|
|
invoke-virtual {v9}, Landroid/support/v7/view/menu/MenuBuilder;->flagActionItems()V
|
|
|
|
iget-object v9, p0, Landroid/support/v7/view/menu/BaseMenuPresenter;->mMenu:Landroid/support/v7/view/menu/MenuBuilder;
|
|
|
|
invoke-virtual {v9}, Landroid/support/v7/view/menu/MenuBuilder;->getVisibleItems()Ljava/util/ArrayList;
|
|
|
|
move-result-object v8
|
|
|
|
.local v8, "visibleItems":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/support/v7/view/menu/MenuItemImpl;>;"
|
|
invoke-virtual {v8}, Ljava/util/ArrayList;->size()I
|
|
|
|
move-result v4
|
|
|
|
.local v4, "itemCount":I
|
|
const/4 v2, 0x0
|
|
|
|
.local v2, "i":I
|
|
:goto_0
|
|
if-ge v2, v4, :cond_6
|
|
|
|
invoke-virtual {v8, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Landroid/support/v7/view/menu/MenuItemImpl;
|
|
|
|
.local v3, "item":Landroid/support/v7/view/menu/MenuItemImpl;
|
|
invoke-virtual {p0, v0, v3}, Landroid/support/v7/view/menu/BaseMenuPresenter;->shouldIncludeItem(ILandroid/support/v7/view/menu/MenuItemImpl;)Z
|
|
|
|
move-result v9
|
|
|
|
if-eqz v9, :cond_4
|
|
|
|
invoke-virtual {v7, v0}, Landroid/view/ViewGroup;->getChildAt(I)Landroid/view/View;
|
|
|
|
move-result-object v1
|
|
|
|
.local v1, "convertView":Landroid/view/View;
|
|
instance-of v9, v1, Landroid/support/v7/view/menu/MenuView$ItemView;
|
|
|
|
if-eqz v9, :cond_5
|
|
|
|
move-object v9, v1
|
|
|
|
check-cast v9, Landroid/support/v7/view/menu/MenuView$ItemView;
|
|
|
|
invoke-interface {v9}, Landroid/support/v7/view/menu/MenuView$ItemView;->getItemData()Landroid/support/v7/view/menu/MenuItemImpl;
|
|
|
|
move-result-object v6
|
|
|
|
.local v6, "oldItem":Landroid/support/v7/view/menu/MenuItemImpl;
|
|
:goto_1
|
|
invoke-virtual {p0, v3, v1, v7}, Landroid/support/v7/view/menu/BaseMenuPresenter;->getItemView(Landroid/support/v7/view/menu/MenuItemImpl;Landroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
|
|
|
|
move-result-object v5
|
|
|
|
.local v5, "itemView":Landroid/view/View;
|
|
if-eq v3, v6, :cond_2
|
|
|
|
const/4 v9, 0x0
|
|
|
|
invoke-virtual {v5, v9}, Landroid/view/View;->setPressed(Z)V
|
|
|
|
invoke-static {v5}, Landroid/support/v4/view/ViewCompat;->jumpDrawablesToCurrentState(Landroid/view/View;)V
|
|
|
|
:cond_2
|
|
if-eq v5, v1, :cond_3
|
|
|
|
invoke-virtual {p0, v5, v0}, Landroid/support/v7/view/menu/BaseMenuPresenter;->addItemView(Landroid/view/View;I)V
|
|
|
|
:cond_3
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
.end local v1 # "convertView":Landroid/view/View;
|
|
.end local v5 # "itemView":Landroid/view/View;
|
|
.end local v6 # "oldItem":Landroid/support/v7/view/menu/MenuItemImpl;
|
|
:cond_4
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
.restart local v1 # "convertView":Landroid/view/View;
|
|
:cond_5
|
|
const/4 v6, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
.end local v1 # "convertView":Landroid/view/View;
|
|
.end local v2 # "i":I
|
|
.end local v3 # "item":Landroid/support/v7/view/menu/MenuItemImpl;
|
|
.end local v4 # "itemCount":I
|
|
.end local v8 # "visibleItems":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/support/v7/view/menu/MenuItemImpl;>;"
|
|
:cond_6
|
|
:goto_2
|
|
invoke-virtual {v7}, Landroid/view/ViewGroup;->getChildCount()I
|
|
|
|
move-result v9
|
|
|
|
if-ge v0, v9, :cond_0
|
|
|
|
invoke-virtual {p0, v7, v0}, Landroid/support/v7/view/menu/BaseMenuPresenter;->filterLeftoverView(Landroid/view/ViewGroup;I)Z
|
|
|
|
move-result v9
|
|
|
|
if-nez v9, :cond_6
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
goto :goto_2
|
|
.end method
|