public class ListMenuPresenter extends Object implements MenuPresenter, android.widget.AdapterView.OnItemClickListener
MenuPresenter.Callback| Constructor and Description |
|---|
ListMenuPresenter(android.content.Context context,
int itemLayoutRes) |
ListMenuPresenter(int itemLayoutRes,
int themeRes) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
android.widget.ListAdapter |
getAdapter() |
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 |
onItemClick(android.widget.AdapterView<?> parent,
android.view.View view,
int position,
long id) |
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 |
restoreHierarchyState(android.os.Bundle inState) |
void |
saveHierarchyState(android.os.Bundle outState) |
void |
setCallback(MenuPresenter.Callback cb)
Set a callback object that will be notified of menu events
related to this specific presentation.
|
void |
setId(int id) |
void |
setItemIndexOffset(int offset) |
void |
updateMenuView(boolean cleared)
Update the menu UI in response to a change.
|
public static final String VIEWS_TAG
public ListMenuPresenter(android.content.Context context,
int itemLayoutRes)
public ListMenuPresenter(int itemLayoutRes,
int themeRes)
public boolean collapseItemActionView(MenuBuilder menu, MenuItemImpl item)
MenuPresentercollapseItemActionView in interface MenuPresentermenu - Menu containing the item to be collapseditem - Item to be collapsedpublic boolean expandItemActionView(MenuBuilder menu, MenuItemImpl item)
MenuPresenterexpandItemActionView in interface MenuPresentermenu - Menu containing the item to be expandeditem - Item to be expandedpublic boolean flagActionItems()
MenuPresenterflagActionItems in interface MenuPresenterpublic android.widget.ListAdapter getAdapter()
public int getId()
MenuPresentergetId in interface MenuPresenterpublic MenuView getMenuView(android.view.ViewGroup root)
MenuPresenter#initForMenu(Context, Menu).getMenuView in interface MenuPresenterroot - Intended parent of the MenuView.public void initForMenu(android.content.Context context,
MenuBuilder menu)
MenuPresenterMenuBuilder.addMenuPresenter(MenuPresenter)initForMenu in interface MenuPresentercontext - Context for this presenter; used for view creation and resource managementmenu - Menu to hostpublic void onCloseMenu(MenuBuilder menu, boolean allMenusAreClosing)
MenuPresenteronCloseMenu in interface MenuPresentermenu - Menu or submenu that is closing.allMenusAreClosing - True if all associated menus are closing.public void onItemClick(android.widget.AdapterView<?> parent,
android.view.View view,
int position,
long id)
onItemClick in interface android.widget.AdapterView.OnItemClickListenerpublic void onRestoreInstanceState(android.os.Parcelable state)
MenuPresenteronRestoreInstanceState in interface MenuPresenterstate - The previously saved instance statepublic android.os.Parcelable onSaveInstanceState()
MenuPresenterMenuPresenter.onRestoreInstanceState(Parcelable)
method of the presenter sharing the same ID later.onSaveInstanceState in interface MenuPresenterpublic boolean onSubMenuSelected(SubMenuBuilder subMenu)
MenuPresenteronSubMenuSelected in interface MenuPresentersubMenu - SubMenu being openedpublic void restoreHierarchyState(android.os.Bundle inState)
public void saveHierarchyState(android.os.Bundle outState)
public void setCallback(MenuPresenter.Callback cb)
MenuPresentersetCallback in interface MenuPresentercb - Callback that will be notified of future eventspublic void setId(int id)
public void setItemIndexOffset(int offset)
public void updateMenuView(boolean cleared)
MenuPresenterupdateMenuView in interface MenuPresentercleared - true if the menu was entirely clearedCopyright © 2012-2013. All Rights Reserved.