public class ActionMenuPresenter extends BaseMenuPresenter implements ActionProvider.SubUiVisibilityListener
MenuPresenter.Callback
mContext, mInflater, mMenu, mMenuView, mSystemContext, mSystemInflater
Constructor and Description |
---|
ActionMenuPresenter(android.content.Context context) |
Modifier and Type | Method and Description |
---|---|
void |
bindItemView(MenuItemImpl item,
MenuView.ItemView itemView)
Bind item data to an existing item view.
|
boolean |
dismissPopupMenus()
Dismiss all popup menus - overflow and submenus.
|
boolean |
filterLeftoverView(android.view.ViewGroup parent,
int childIndex)
Filter the child view at index and remove it if appropriate.
|
boolean |
flagActionItems()
Called by Menu implementations to flag items that will be shown as actions.
|
android.view.View |
getItemView(MenuItemImpl item,
android.view.View convertView,
android.view.ViewGroup parent)
Prepare an item view for use.
|
MenuView |
getMenuView(android.view.ViewGroup root)
Retrieve a MenuView to display the menu specified in
#initForMenu(Context, Menu) . |
boolean |
hideOverflowMenu()
Hide the overflow menu if it is currently showing.
|
boolean |
hideSubMenus()
Dismiss all submenu popups.
|
void |
initForMenu(android.content.Context context,
MenuBuilder menu)
Initialize this presenter for the given context and menu.
|
boolean |
isOverflowMenuShowing() |
boolean |
isOverflowReserved() |
void |
onCloseMenu(MenuBuilder menu,
boolean allMenusAreClosing)
Called by Menu implementations to indicate that a menu or submenu is
closing.
|
void |
onConfigurationChanged(android.content.res.Configuration newConfig) |
void |
onRestoreInstanceState(android.os.Parcelable state)
Supplies the previously saved instance state to be restored.
|
android.os.Parcelable |
onSaveInstanceState()
Returns a Parcelable describing the current state of the presenter.
|
boolean |
onSubMenuSelected(SubMenuBuilder subMenu)
Called by Menu implementations to indicate that a submenu item
has been selected.
|
void |
onSubUiVisibilityChanged(boolean isVisible) |
static boolean |
reserveOverflow(android.content.Context context) |
void |
setExpandedActionViewsExclusive(boolean isExclusive) |
void |
setItemLimit(int itemCount) |
void |
setReserveOverflow(boolean reserveOverflow) |
void |
setWidthLimit(int width,
boolean strict) |
boolean |
shouldIncludeItem(int childIndex,
MenuItemImpl item)
Filter item by child index and item data.
|
boolean |
showOverflowMenu()
Display the overflow menu if one is present.
|
void |
updateMenuView(boolean cleared)
Reuses item views when it can
|
addItemView, collapseItemActionView, createItemView, expandItemActionView, getId, setCallback, setId
public void initForMenu(android.content.Context context, MenuBuilder menu)
MenuPresenter
MenuBuilder.addMenuPresenter(MenuPresenter)
initForMenu
in interface MenuPresenter
initForMenu
in class BaseMenuPresenter
context
- Context for this presenter; used for view creation and resource managementmenu
- Menu to hostpublic static boolean reserveOverflow(android.content.Context context)
public void onConfigurationChanged(android.content.res.Configuration newConfig)
public void setWidthLimit(int width, boolean strict)
public void setReserveOverflow(boolean reserveOverflow)
public void setItemLimit(int itemCount)
public void setExpandedActionViewsExclusive(boolean isExclusive)
public MenuView getMenuView(android.view.ViewGroup root)
MenuPresenter
#initForMenu(Context, Menu)
.getMenuView
in interface MenuPresenter
getMenuView
in class BaseMenuPresenter
root
- Intended parent of the MenuView.public android.view.View getItemView(MenuItemImpl item, android.view.View convertView, android.view.ViewGroup parent)
BaseMenuPresenter
getItemView
in class BaseMenuPresenter
item
- Item to presentconvertView
- Existing view to reuseparent
- Intended parent view - use for inflation.public void bindItemView(MenuItemImpl item, MenuView.ItemView itemView)
BaseMenuPresenter
bindItemView
in class BaseMenuPresenter
item
- Item to binditemView
- View to populate with item datapublic boolean shouldIncludeItem(int childIndex, MenuItemImpl item)
BaseMenuPresenter
shouldIncludeItem
in class BaseMenuPresenter
childIndex
- Indended presentation index of this itemitem
- Item to presentpublic void updateMenuView(boolean cleared)
BaseMenuPresenter
updateMenuView
in interface MenuPresenter
updateMenuView
in class BaseMenuPresenter
cleared
- true if the menu was entirely clearedpublic boolean filterLeftoverView(android.view.ViewGroup parent, int childIndex)
BaseMenuPresenter
filterLeftoverView
in class BaseMenuPresenter
parent
- Parent to filter fromchildIndex
- Index to filterpublic boolean onSubMenuSelected(SubMenuBuilder subMenu)
MenuPresenter
onSubMenuSelected
in interface MenuPresenter
onSubMenuSelected
in class BaseMenuPresenter
subMenu
- SubMenu being openedpublic boolean showOverflowMenu()
public boolean hideOverflowMenu()
public boolean dismissPopupMenus()
public boolean hideSubMenus()
public boolean isOverflowMenuShowing()
public boolean isOverflowReserved()
public boolean flagActionItems()
MenuPresenter
flagActionItems
in interface MenuPresenter
flagActionItems
in class BaseMenuPresenter
public void onCloseMenu(MenuBuilder menu, boolean allMenusAreClosing)
MenuPresenter
onCloseMenu
in interface MenuPresenter
onCloseMenu
in class BaseMenuPresenter
menu
- Menu or submenu that is closing.allMenusAreClosing
- True if all associated menus are closing.public android.os.Parcelable onSaveInstanceState()
MenuPresenter
MenuPresenter.onRestoreInstanceState(Parcelable)
method of the presenter sharing the same ID later.onSaveInstanceState
in interface MenuPresenter
public void onRestoreInstanceState(android.os.Parcelable state)
MenuPresenter
onRestoreInstanceState
in interface MenuPresenter
state
- The previously saved instance statepublic void onSubUiVisibilityChanged(boolean isVisible)
onSubUiVisibilityChanged
in interface ActionProvider.SubUiVisibilityListener
Copyright © 2011–2014. All rights reserved.