public class SubMenuBuilder extends MenuBuilder implements SubMenu
MenuBuilder.Callback, MenuBuilder.ItemInvoker
CATEGORY_ALTERNATIVE, CATEGORY_CONTAINER, CATEGORY_MASK, CATEGORY_SECONDARY, CATEGORY_SHIFT, CATEGORY_SYSTEM, FIRST, FLAG_ALWAYS_PERFORM_CLOSE, FLAG_APPEND_TO_GROUP, FLAG_PERFORM_NO_CLOSE, NONE, USER_MASK, USER_SHIFT
Constructor and Description |
---|
SubMenuBuilder(android.content.Context context,
MenuBuilder parentMenu,
MenuItemImpl item) |
Modifier and Type | Method and Description |
---|---|
boolean |
collapseItemActionView(MenuItemImpl item) |
boolean |
expandItemActionView(MenuItemImpl item) |
String |
getActionViewStatesKey() |
MenuItem |
getItem()
Gets the
MenuItem that represents this submenu in the parent
menu. |
Menu |
getParentMenu() |
MenuBuilder |
getRootMenu()
Gets the root menu (if this is a submenu, find its root menu).
|
boolean |
isQwertyMode() |
boolean |
isShortcutsVisible() |
void |
setCallback(MenuBuilder.Callback callback) |
SubMenu |
setHeaderIcon(android.graphics.drawable.Drawable icon)
Sets the submenu header's icon to the icon given in icon
Drawable . |
SubMenu |
setHeaderIcon(int iconRes)
Sets the submenu header's icon to the icon given in iconRes
resource id.
|
SubMenu |
setHeaderTitle(CharSequence title)
Sets the submenu header's title to the title given in title.
|
SubMenu |
setHeaderTitle(int titleRes)
Sets the submenu header's title to the title given in titleRes
resource identifier.
|
SubMenu |
setHeaderView(android.view.View view)
Sets the header of the submenu to the
View given in
view. |
SubMenu |
setIcon(android.graphics.drawable.Drawable icon)
Change the icon associated with this submenu's item in its parent menu.
|
SubMenu |
setIcon(int iconRes)
Change the icon associated with this submenu's item in its parent menu.
|
void |
setQwertyMode(boolean isQwerty)
Control whether the menu should be running in qwerty mode (alphabetic
shortcuts) or 12-key mode (numeric shortcuts).
|
void |
setShortcutsVisible(boolean shortcutsVisible)
Sets whether the shortcuts should be visible on menus.
|
add, add, add, add, addIntentOptions, addMenuPresenter, addSubMenu, addSubMenu, addSubMenu, addSubMenu, bindNativeOverflow, changeMenuMode, clear, clearAll, clearHeader, close, findGroupIndex, findGroupIndex, findItem, findItemIndex, flagActionItems, getContext, getExpandedItem, getHeaderIcon, getHeaderTitle, getHeaderView, getItem, hasVisibleItems, isShortcutKey, performIdentifierAction, performItemAction, performShortcut, removeGroup, removeItem, removeItemAt, removeMenuPresenter, restoreActionViewStates, restorePresenterStates, saveActionViewStates, savePresenterStates, setCurrentMenuInfo, setDefaultShowAsAction, setGroupCheckable, setGroupEnabled, setGroupVisible, setHeaderIconInt, setHeaderIconInt, setHeaderTitleInt, setHeaderTitleInt, setHeaderViewInt, size, startDispatchingItemsChanged, stopDispatchingItemsChanged
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearHeader
add, add, add, add, addIntentOptions, addSubMenu, addSubMenu, addSubMenu, addSubMenu, clear, close, findItem, getItem, hasVisibleItems, isShortcutKey, performIdentifierAction, performShortcut, removeGroup, removeItem, setGroupCheckable, setGroupEnabled, setGroupVisible, size
public SubMenuBuilder(android.content.Context context, MenuBuilder parentMenu, MenuItemImpl item)
public void setQwertyMode(boolean isQwerty)
Menu
setQwertyMode
in interface Menu
setQwertyMode
in class MenuBuilder
isQwerty
- If true the menu will use alphabetic shortcuts; else it
will use numeric shortcuts.public boolean isQwertyMode()
public void setShortcutsVisible(boolean shortcutsVisible)
MenuBuilder
setShortcutsVisible
in class MenuBuilder
shortcutsVisible
- Whether shortcuts should be visible (if true and a
menu item does not have a shortcut defined, that item will
still NOT show a shortcut)public boolean isShortcutsVisible()
isShortcutsVisible
in class MenuBuilder
public Menu getParentMenu()
public MenuItem getItem()
SubMenu
MenuItem
that represents this submenu in the parent
menu. Use this for setting additional item attributes.public void setCallback(MenuBuilder.Callback callback)
setCallback
in class MenuBuilder
public MenuBuilder getRootMenu()
MenuBuilder
getRootMenu
in class MenuBuilder
public SubMenu setIcon(android.graphics.drawable.Drawable icon)
SubMenu
setIcon
in interface SubMenu
icon
- The new icon (as a Drawable) to be displayed.MenuItem.setIcon(Drawable)
public SubMenu setIcon(int iconRes)
SubMenu
setIcon
in interface SubMenu
iconRes
- The new icon (as a resource ID) to be displayed.MenuItem.setIcon(int)
public SubMenu setHeaderIcon(android.graphics.drawable.Drawable icon)
SubMenu
Drawable
.setHeaderIcon
in interface SubMenu
icon
- The Drawable
used for the icon.public SubMenu setHeaderIcon(int iconRes)
SubMenu
setHeaderIcon
in interface SubMenu
iconRes
- The resource identifier used for the icon.public SubMenu setHeaderTitle(CharSequence title)
SubMenu
setHeaderTitle
in interface SubMenu
title
- The character sequence used for the title.public SubMenu setHeaderTitle(int titleRes)
SubMenu
setHeaderTitle
in interface SubMenu
titleRes
- The string resource identifier used for the title.public SubMenu setHeaderView(android.view.View view)
SubMenu
View
given in
view. This replaces the header title and icon (and those
replace this).setHeaderView
in interface SubMenu
view
- The View
used for the header.public boolean expandItemActionView(MenuItemImpl item)
expandItemActionView
in class MenuBuilder
public boolean collapseItemActionView(MenuItemImpl item)
collapseItemActionView
in class MenuBuilder
public String getActionViewStatesKey()
getActionViewStatesKey
in class MenuBuilder
Copyright © 2011–2014. All rights reserved.