|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MenuPresenter
A MenuPresenter is responsible for building views for a Menu object. It takes over some responsibility from the old style monolithic MenuBuilder class.
| Nested Class Summary | |
|---|---|
static interface |
MenuPresenter.Callback
Called by menu implementation to notify another component of open/close events. |
| Method Summary | |
|---|---|
boolean |
collapseItemActionView(MenuBuilder menu,
MenuItemImpl item)
Called when a menu item with a collapsable action view should collapse its action view. |
boolean |
expandItemActionView(MenuBuilder menu,
MenuItemImpl item)
Called when a menu item with a collapsable action view should expand its action view. |
boolean |
flagActionItems()
Called by Menu implementations to flag items that will be shown as actions. |
int |
getId()
Returns an ID for determining how to save/restore instance state. |
MenuView |
getMenuView(android.view.ViewGroup root)
Retrieve a MenuView to display the menu specified in #initForMenu(Context, Menu). |
void |
initForMenu(android.content.Context context,
MenuBuilder menu)
Initialize this presenter for the given context and menu. |
void |
onCloseMenu(MenuBuilder menu,
boolean allMenusAreClosing)
Called by Menu implementations to indicate that a menu or submenu is closing. |
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 |
setCallback(MenuPresenter.Callback cb)
Set a callback object that will be notified of menu events related to this specific presentation. |
void |
updateMenuView(boolean cleared)
Update the menu UI in response to a change. |
| Method Detail |
|---|
void initForMenu(android.content.Context context,
MenuBuilder menu)
MenuBuilder.addMenuPresenter(MenuPresenter)
context - Context for this presenter; used for view creation and resource managementmenu - Menu to hostMenuView getMenuView(android.view.ViewGroup root)
#initForMenu(Context, Menu).
root - Intended parent of the MenuView.
void updateMenuView(boolean cleared)
cleared - true if the menu was entirely clearedvoid setCallback(MenuPresenter.Callback cb)
cb - Callback that will be notified of future eventsboolean onSubMenuSelected(SubMenuBuilder subMenu)
subMenu - SubMenu being opened
void onCloseMenu(MenuBuilder menu,
boolean allMenusAreClosing)
menu - Menu or submenu that is closing.allMenusAreClosing - True if all associated menus are closing.boolean flagActionItems()
boolean expandItemActionView(MenuBuilder menu,
MenuItemImpl item)
menu - Menu containing the item to be expandeditem - Item to be expanded
boolean collapseItemActionView(MenuBuilder menu,
MenuItemImpl item)
menu - Menu containing the item to be collapseditem - Item to be collapsed
int getId()
android.os.Parcelable onSaveInstanceState()
onRestoreInstanceState(Parcelable)
method of the presenter sharing the same ID later.
void onRestoreInstanceState(android.os.Parcelable state)
state - The previously saved instance state
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||