Methods Summary |
---|
public boolean | collapseItemActionView(MenuBuilder menu, MenuItemImpl item)
return false;
|
public boolean | expandItemActionView(MenuBuilder menu, MenuItemImpl item)
return false;
|
public boolean | flagActionItems()
return false;
|
public android.widget.ListAdapter | getAdapter()Call this instead of getMenuView if you want to manage your own ListView.
For proper operation, the ListView hosting this adapter should add
this presenter as an OnItemClickListener.
if (mAdapter == null) {
mAdapter = new MenuAdapter();
}
return mAdapter;
|
public int | getId()
return mId;
|
int | getItemIndexOffset()
return mItemIndexOffset;
|
public MenuView | getMenuView(android.view.ViewGroup root)
if (mMenuView == null) {
mMenuView = (ExpandedMenuView) mInflater.inflate(
R.layout.abc_expanded_menu_layout, root, false);
if (mAdapter == null) {
mAdapter = new MenuAdapter();
}
mMenuView.setAdapter(mAdapter);
mMenuView.setOnItemClickListener(this);
}
return mMenuView;
|
public void | initForMenu(android.content.Context context, MenuBuilder menu)
if (mThemeRes != 0) {
mContext = new ContextThemeWrapper(context, mThemeRes);
mInflater = LayoutInflater.from(mContext);
} else if (mContext != null) {
mContext = context;
if (mInflater == null) {
mInflater = LayoutInflater.from(mContext);
}
}
mMenu = menu;
if (mAdapter != null) {
mAdapter.notifyDataSetChanged();
}
|
public void | onCloseMenu(MenuBuilder menu, boolean allMenusAreClosing)
if (mCallback != null) {
mCallback.onCloseMenu(menu, allMenusAreClosing);
}
|
public void | onItemClick(android.widget.AdapterView parent, android.view.View view, int position, long id)
mMenu.performItemAction(mAdapter.getItem(position), this, 0);
|
public void | onRestoreInstanceState(android.os.Parcelable state)
restoreHierarchyState((Bundle) state);
|
public android.os.Parcelable | onSaveInstanceState()
if (mMenuView == null) {
return null;
}
Bundle state = new Bundle();
saveHierarchyState(state);
return state;
|
public boolean | onSubMenuSelected(SubMenuBuilder subMenu)
if (!subMenu.hasVisibleItems()) return false;
// The window manager will give us a token.
new MenuDialogHelper(subMenu).show(null);
if (mCallback != null) {
mCallback.onOpenSubMenu(subMenu);
}
return true;
|
public void | restoreHierarchyState(android.os.Bundle inState)
SparseArray<Parcelable> viewStates = inState.getSparseParcelableArray(VIEWS_TAG);
if (viewStates != null) {
((View) mMenuView).restoreHierarchyState(viewStates);
}
|
public void | saveHierarchyState(android.os.Bundle outState)
SparseArray<Parcelable> viewStates = new SparseArray<Parcelable>();
if (mMenuView != null) {
((View) mMenuView).saveHierarchyState(viewStates);
}
outState.putSparseParcelableArray(VIEWS_TAG, viewStates);
|
public void | setCallback(Callback cb)
mCallback = cb;
|
public void | setId(int id)
mId = id;
|
public void | setItemIndexOffset(int offset)
mItemIndexOffset = offset;
if (mMenuView != null) {
updateMenuView(false);
}
|
public void | updateMenuView(boolean cleared)
if (mAdapter != null) mAdapter.notifyDataSetChanged();
|