public class BottomNavigationPresenter extends Object implements MenuPresenter
MenuPresenter.Callback
Constructor and Description |
---|
BottomNavigationPresenter() |
Modifier and Type | Method and Description |
---|---|
boolean |
collapseItemActionView(MenuBuilder menu,
MenuItemImpl item)
Called when a menu item with a collapsible action view should collapse its action view.
|
boolean |
expandItemActionView(MenuBuilder menu,
MenuItemImpl item)
Called when a menu item with a collapsible 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(ViewGroup root)
Retrieve a MenuView to display the menu specified in
MenuPresenter.initForMenu(Context, MenuBuilder) . |
void |
initForMenu(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(Parcelable state)
Supplies the previously saved instance state to be restored.
|
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 |
setBottomNavigationMenuView(BottomNavigationMenuView menuView) |
void |
setCallback(MenuPresenter.Callback cb)
Set a callback object that will be notified of menu events
related to this specific presentation.
|
void |
setUpdateSuspended(boolean updateSuspended) |
void |
updateMenuView(boolean cleared)
Update the menu UI in response to a change.
|
public void setBottomNavigationMenuView(BottomNavigationMenuView menuView)
public void initForMenu(Context context, MenuBuilder menu)
MenuPresenter
MenuBuilder.addMenuPresenter(MenuPresenter)
initForMenu
in interface MenuPresenter
context
- Context for this presenter; used for view creation and resource managementmenu
- Menu to hostpublic MenuView getMenuView(ViewGroup root)
MenuPresenter
MenuPresenter.initForMenu(Context, MenuBuilder)
.getMenuView
in interface MenuPresenter
root
- Intended parent of the MenuView.public void updateMenuView(boolean cleared)
MenuPresenter
updateMenuView
in interface MenuPresenter
cleared
- true if the menu was entirely clearedpublic void setCallback(MenuPresenter.Callback cb)
MenuPresenter
setCallback
in interface MenuPresenter
cb
- Callback that will be notified of future eventspublic boolean onSubMenuSelected(SubMenuBuilder subMenu)
MenuPresenter
onSubMenuSelected
in interface MenuPresenter
subMenu
- SubMenu being openedpublic void onCloseMenu(MenuBuilder menu, boolean allMenusAreClosing)
MenuPresenter
onCloseMenu
in interface MenuPresenter
menu
- Menu or submenu that is closing.allMenusAreClosing
- True if all associated menus are closing.public boolean flagActionItems()
MenuPresenter
flagActionItems
in interface MenuPresenter
public boolean expandItemActionView(MenuBuilder menu, MenuItemImpl item)
MenuPresenter
expandItemActionView
in interface MenuPresenter
menu
- Menu containing the item to be expandeditem
- Item to be expandedpublic boolean collapseItemActionView(MenuBuilder menu, MenuItemImpl item)
MenuPresenter
collapseItemActionView
in interface MenuPresenter
menu
- Menu containing the item to be collapseditem
- Item to be collapsedpublic int getId()
MenuPresenter
getId
in interface MenuPresenter
public Parcelable onSaveInstanceState()
MenuPresenter
MenuPresenter.onRestoreInstanceState(Parcelable)
method of the presenter sharing the same ID later.onSaveInstanceState
in interface MenuPresenter
public void onRestoreInstanceState(Parcelable state)
MenuPresenter
onRestoreInstanceState
in interface MenuPresenter
state
- The previously saved instance statepublic void setUpdateSuspended(boolean updateSuspended)