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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
getItem()
Gets theMenuItem
that represents this submenu in the parent menu.Gets the root menu (if this is a submenu, find its root menu).boolean
boolean
boolean
void
setCallback
(MenuBuilder.Callback callback) void
setGroupDividerEnabled
(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 theView
given in view.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.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, stopDispatchingItemsChanged
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface icyllis.modernui.view.Menu
add, add, addSubMenu, addSubMenu, clear, close, findItem, getItem, hasVisibleItems, isShortcutKey, performIdentifierAction, performShortcut, removeGroup, removeItem, setGroupCheckable, setGroupEnabled, setGroupVisible, size
Methods inherited from interface icyllis.modernui.view.SubMenu
clearHeader
-
Constructor Details
-
Method Details
-
setQwertyMode
public void setQwertyMode(boolean isQwerty) Description copied from interface:Menu
Control whether the menu should be running in qwerty mode (alphabetic shortcuts) or 12-key mode (numeric shortcuts).- Specified by:
setQwertyMode
in interfaceMenu
- Overrides:
setQwertyMode
in 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:MenuBuilder
Sets 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:
setShortcutsVisible
in 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:
isShortcutsVisible
in classMenuBuilder
- Returns:
- Whether shortcuts should be visible on menus.
-
getParentMenu
-
getItem
Description copied from interface:SubMenu
Gets theMenuItem
that represents this submenu in the parent menu. Use this for setting additional item attributes. -
getRootMenu
Description copied from class:MenuBuilder
Gets the root menu (if this is a submenu, find its root menu).- Overrides:
getRootMenu
in classMenuBuilder
- Returns:
- The root menu.
-
setIcon
Description copied from interface:SubMenu
Change the icon associated with this submenu's item in its parent menu. -
setHeaderIcon
Description copied from interface:SubMenu
Sets the submenu header's icon to the icon given in iconDrawable
.- Specified by:
setHeaderIcon
in interfaceSubMenu
- Parameters:
icon
- TheDrawable
used for the icon.- Returns:
- This SubMenu so additional setters can be called.
-
setHeaderTitle
Description copied from interface:SubMenu
Sets the submenu header's title to the title given in title.- Specified by:
setHeaderTitle
in interfaceSubMenu
- Parameters:
title
- The character sequence used for the title.- Returns:
- This SubMenu so additional setters can be called.
-
setHeaderView
Description copied from interface:SubMenu
Sets the header of the submenu to theView
given in view. This replaces the header title and icon (and those replace this).- Specified by:
setHeaderView
in interfaceSubMenu
- Parameters:
view
- TheView
used for the header.- Returns:
- This SubMenu so additional setters can be called.
-
setGroupDividerEnabled
public void setGroupDividerEnabled(boolean groupDividerEnabled) Description copied from interface:Menu
Enable or disable the group dividers.- Specified by:
setGroupDividerEnabled
in interfaceMenu
- Overrides:
setGroupDividerEnabled
in classMenuBuilder
-
isGroupDividerEnabled
public boolean isGroupDividerEnabled()- Overrides:
isGroupDividerEnabled
in classMenuBuilder
-