Package icyllis.modernui.view.menu
Interface MenuPresenter
- All Known Implementing Classes:
CascadingMenuPopup,MenuPopup,StandardMenuPopup
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
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceCalled by menu implementation to notify another component of open/close events. -
Method Summary
Modifier and TypeMethodDescriptionbooleancollapseItemActionView(MenuBuilder menu, MenuItemImpl item) Called when a menu item with a collapsable action view should collapse its action view.booleanexpandItemActionView(MenuBuilder menu, MenuItemImpl item) Called when a menu item with a collapsable action view should expand its action view.booleanCalled by Menu implementations to flag items that will be shown as actions.intgetId()Returns an ID for determining how to save/restore instance state.getMenuView(ViewGroup root) Retrieve a MenuView to display the menu specified ininitForMenu(Context, MenuBuilder).voidinitForMenu(Context context, MenuBuilder menu) Initializes this presenter for the given context and menu.voidonCloseMenu(MenuBuilder menu, boolean allMenusAreClosing) Called by Menu implementations to indicate that a menu or submenu is closing.booleanonSubMenuSelected(SubMenuBuilder subMenu) Called by Menu implementations to indicate that a submenu item has been selected.voidSet a callback object that will be notified of menu events related to this specific presentation.voidupdateMenuView(boolean cleared) Update the menu UI in response to a change.
-
Method Details
-
getMenuView
Retrieve a MenuView to display the menu specified ininitForMenu(Context, MenuBuilder).- Parameters:
root- Intended parent of the MenuView.- Returns:
- A freshly created MenuView.
-
updateMenuView
void updateMenuView(boolean cleared) Update the menu UI in response to a change. Called by MenuBuilder during the normal course of operation.- Parameters:
cleared- true if the menu was entirely cleared
-
flagActionItems
boolean flagActionItems()Called by Menu implementations to flag items that will be shown as actions.- Returns:
- true if this presenter changed the action status of any items.
-
getId
int getId()Returns an ID for determining how to save/restore instance state.- Returns:
- a valid ID value.