|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.actionbarsherlock.internal.view.menu.MenuPopupHelper
public class MenuPopupHelper
Presents a menu as a small, simple popup anchored to another view.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.actionbarsherlock.internal.view.menu.MenuPresenter |
|---|
MenuPresenter.Callback |
| Constructor Summary | |
|---|---|
MenuPopupHelper(android.content.Context context,
MenuBuilder menu)
|
|
MenuPopupHelper(android.content.Context context,
MenuBuilder menu,
android.view.View anchorView)
|
|
MenuPopupHelper(android.content.Context context,
MenuBuilder menu,
android.view.View anchorView,
boolean overflowOnly)
|
|
| Method Summary | |
|---|---|
boolean |
collapseItemActionView(MenuBuilder menu,
MenuItemImpl item)
Called when a menu item with a collapsable action view should collapse its action view. |
void |
dismiss()
|
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. |
boolean |
isShowing()
|
void |
onCloseMenu(MenuBuilder menu,
boolean allMenusAreClosing)
Called by Menu implementations to indicate that a menu or submenu is closing. |
void |
onDismiss()
|
void |
onGlobalLayout()
|
void |
onItemClick(android.widget.AdapterView<?> parent,
android.view.View view,
int position,
long id)
|
boolean |
onKey(android.view.View v,
int keyCode,
android.view.KeyEvent event)
|
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 |
onViewAttachedToWindow(android.view.View v)
|
void |
onViewDetachedFromWindow(android.view.View v)
|
void |
setAnchorView(android.view.View anchor)
|
void |
setCallback(MenuPresenter.Callback cb)
Set a callback object that will be notified of menu events related to this specific presentation. |
void |
setForceShowIcon(boolean forceShow)
|
void |
show()
|
boolean |
tryShow()
|
void |
updateMenuView(boolean cleared)
Update the menu UI in response to a change. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MenuPopupHelper(android.content.Context context,
MenuBuilder menu)
public MenuPopupHelper(android.content.Context context,
MenuBuilder menu,
android.view.View anchorView)
public MenuPopupHelper(android.content.Context context,
MenuBuilder menu,
android.view.View anchorView,
boolean overflowOnly)
| Method Detail |
|---|
public void setAnchorView(android.view.View anchor)
public void setForceShowIcon(boolean forceShow)
public void show()
public boolean tryShow()
public void dismiss()
public void onDismiss()
onDismiss in interface android.widget.PopupWindow.OnDismissListenerpublic boolean isShowing()
public void onItemClick(android.widget.AdapterView<?> parent,
android.view.View view,
int position,
long id)
onItemClick in interface android.widget.AdapterView.OnItemClickListener
public boolean onKey(android.view.View v,
int keyCode,
android.view.KeyEvent event)
onKey in interface android.view.View.OnKeyListenerpublic void onGlobalLayout()
onGlobalLayout in interface android.view.ViewTreeObserver.OnGlobalLayoutListenerpublic void onViewAttachedToWindow(android.view.View v)
onViewAttachedToWindow in interface View_OnAttachStateChangeListenerpublic void onViewDetachedFromWindow(android.view.View v)
onViewDetachedFromWindow in interface View_OnAttachStateChangeListener
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 MenuView getMenuView(android.view.ViewGroup root)
MenuPresenter#initForMenu(Context, Menu).
getMenuView in interface MenuPresenterroot - Intended parent of the MenuView.
public void updateMenuView(boolean cleared)
MenuPresenter
updateMenuView in interface MenuPresentercleared - true if the menu was entirely clearedpublic void setCallback(MenuPresenter.Callback cb)
MenuPresenter
setCallback in interface MenuPresentercb - Callback that will be notified of future eventspublic boolean onSubMenuSelected(SubMenuBuilder subMenu)
MenuPresenter
onSubMenuSelected in interface MenuPresentersubMenu - SubMenu being opened
public void onCloseMenu(MenuBuilder menu,
boolean allMenusAreClosing)
MenuPresenter
onCloseMenu in interface MenuPresentermenu - 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 MenuPresentermenu - Menu containing the item to be expandeditem - Item to be expanded
public boolean collapseItemActionView(MenuBuilder menu,
MenuItemImpl item)
MenuPresenter
collapseItemActionView in interface MenuPresentermenu - Menu containing the item to be collapseditem - Item to be collapsed
public int getId()
MenuPresenter
getId in interface MenuPresenterpublic android.os.Parcelable onSaveInstanceState()
MenuPresenterMenuPresenter.onRestoreInstanceState(Parcelable)
method of the presenter sharing the same ID later.
onSaveInstanceState in interface MenuPresenterpublic void onRestoreInstanceState(android.os.Parcelable state)
MenuPresenter
onRestoreInstanceState in interface MenuPresenterstate - The previously saved instance state
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||