Package icyllis.modernui.view.menu
Class SubMenuBuilder
java.lang.Object
icyllis.modernui.view.menu.MenuBuilder
icyllis.modernui.view.menu.SubMenuBuilder
The model for a sub menu, which is an extension of the menu. Most methods are proxied to
the parent menu.
-
Nested Class Summary
Nested classes/interfaces inherited from class icyllis.modernui.view.menu.MenuBuilder
MenuBuilder.Callback, MenuBuilder.ItemInvoker -
Field Summary
Fields inherited from interface icyllis.modernui.view.Menu
CATEGORY_ALTERNATIVE, CATEGORY_CONTAINER, CATEGORY_MASK, CATEGORY_SECONDARY, CATEGORY_SHIFT, CATEGORY_SYSTEM, FIRST, FLAG_ALWAYS_PERFORM_CLOSE, FLAG_PERFORM_NO_CLOSE, NONE, SUPPORTED_MODIFIERS_MASK, USER_MASK, USER_SHIFT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleangetItem()Gets theMenuItemthat represents this submenu in the parent menu.Gets the root menu (if this is a submenu, find its root menu).booleanbooleanbooleanvoidsetCallback(MenuBuilder.Callback callback) voidsetGroupDividerEnabled(boolean groupDividerEnabled) Enable or disable the group dividers.setHeaderIcon(Drawable icon) Sets the submenu header's icon to the icon given in iconDrawable.setHeaderTitle(CharSequence title) Sets the submenu header's title to the title given in title.setHeaderView(View view) Sets the header of the submenu to theViewgiven in view.Change the icon associated with this submenu's item in its parent menu.voidsetQwertyMode(boolean isQwerty) Control whether the menu should be running in qwerty mode (alphabetic shortcuts) or 12-key mode (numeric shortcuts).voidsetShortcutsVisible(boolean shortcutsVisible) Sets whether the shortcuts should be visible on menus.Methods inherited from class icyllis.modernui.view.menu.MenuBuilder
add, add, addMenuPresenter, addMenuPresenter, addSubMenu, addSubMenu, changeMenuMode, clear, clearAll, clearHeader, close, close, findGroupIndex, findGroupIndex, findItem, findItemIndex, flagActionItems, getActionItems, getContext, getExpandedItem, getHeaderIcon, getHeaderTitle, getHeaderView, getItem, getNonActionItems, getVisibleItems, hasVisibleItems, isShortcutKey, onItemsChanged, performIdentifierAction, performItemAction, performItemAction, performShortcut, removeGroup, removeItem, removeItemAt, removeMenuPresenter, setCurrentMenuInfo, setDefaultShowAsAction, setGroupCheckable, setGroupEnabled, setGroupVisible, setHeaderIconInt, setHeaderTitleInt, setHeaderViewInt, setOptionalIconsVisible, size, startDispatchingItemsChanged, stopDispatchingItemsChangedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface icyllis.modernui.view.Menu
add, add, addSubMenu, addSubMenu, clear, close, findItem, getItem, hasVisibleItems, isShortcutKey, performIdentifierAction, performShortcut, removeGroup, removeItem, setGroupCheckable, setGroupEnabled, setGroupVisible, setOptionalIconsVisible, sizeMethods inherited from interface icyllis.modernui.view.SubMenu
clearHeader
-
Constructor Details
-
Method Details
-
setQwertyMode
public void setQwertyMode(boolean isQwerty) Description copied from interface:MenuControl whether the menu should be running in qwerty mode (alphabetic shortcuts) or 12-key mode (numeric shortcuts).- Specified by:
setQwertyModein interfaceMenu- Overrides:
setQwertyModein classMenuBuilder- Parameters:
isQwerty- If true the menu will use alphabetic shortcuts; else it will use numeric shortcuts.
-
isQwertyMode
public boolean isQwertyMode() -
setShortcutsVisible
public void setShortcutsVisible(boolean shortcutsVisible) Description copied from class:MenuBuilderSets whether the shortcuts should be visible on menus. Devices without hardware key input will never make shortcuts visible even if this method is passed 'true'.- Overrides:
setShortcutsVisiblein classMenuBuilder- Parameters:
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)
-
isShortcutsVisible
public boolean isShortcutsVisible()- Overrides:
isShortcutsVisiblein classMenuBuilder- Returns:
- Whether shortcuts should be visible on menus.
-
getParentMenu
-
getItem
Description copied from interface:SubMenuGets theMenuItemthat represents this submenu in the parent menu. Use this for setting additional item attributes. -
getRootMenu
Description copied from class:MenuBuilderGets the root menu (if this is a submenu, find its root menu).- Overrides:
getRootMenuin classMenuBuilder- Returns:
- The root menu.
-
setIcon
Description copied from interface:SubMenuChange the icon associated with this submenu's item in its parent menu. -
setHeaderIcon
Description copied from interface:SubMenuSets the submenu header's icon to the icon given in iconDrawable.- Specified by:
setHeaderIconin interfaceSubMenu- Parameters:
icon- TheDrawableused for the icon.- Returns:
- This SubMenu so additional setters can be called.
-
setHeaderTitle
Description copied from interface:SubMenuSets the submenu header's title to the title given in title.- Specified by:
setHeaderTitlein interfaceSubMenu- Parameters:
title- The character sequence used for the title.- Returns:
- This SubMenu so additional setters can be called.
-
setHeaderView
Description copied from interface:SubMenuSets the header of the submenu to theViewgiven in view. This replaces the header title and icon (and those replace this).- Specified by:
setHeaderViewin interfaceSubMenu- Parameters:
view- TheViewused for the header.- Returns:
- This SubMenu so additional setters can be called.
-
setGroupDividerEnabled
public void setGroupDividerEnabled(boolean groupDividerEnabled) Description copied from interface:MenuEnable or disable the group dividers.- Specified by:
setGroupDividerEnabledin interfaceMenu- Overrides:
setGroupDividerEnabledin classMenuBuilder
-
isGroupDividerEnabled
public boolean isGroupDividerEnabled()- Overrides:
isGroupDividerEnabledin classMenuBuilder
-