public static interface MenuView.ItemView
initialize(MenuItemImpl, int) must be called
for the item to be functional.| Modifier and Type | Method and Description |
|---|---|
MenuItemImpl |
getItemData()
Gets the item data that this view is displaying.
|
void |
initialize(MenuItemImpl itemData,
int menuType)
Initializes with the provided MenuItemData.
|
boolean |
prefersCondensedTitle()
Whether this item view prefers displaying the condensed title rather
than the normal title.
|
void |
setCheckable(boolean checkable)
Displays the checkbox for the item view.
|
void |
setChecked(boolean checked)
Checks the checkbox for the item view.
|
void |
setEnabled(boolean enabled)
Sets the enabled state of the item view.
|
void |
setIcon(android.graphics.drawable.Drawable icon)
Set the icon of this item view.
|
void |
setShortcut(boolean showShortcut,
char shortcutKey)
Sets the shortcut for the item.
|
void |
setTitle(CharSequence title)
Sets the title of the item view.
|
boolean |
showsIcon()
Whether this item view shows an icon.
|
void initialize(MenuItemImpl itemData, int menuType)
itemData - The item that this ItemView should display.menuType - The type of this menu, one of
MenuBuilder#TYPE_ICON, MenuBuilder#TYPE_EXPANDED,
MenuBuilder#TYPE_DIALOG).MenuItemImpl getItemData()
void setTitle(CharSequence title)
title - The title to set.void setEnabled(boolean enabled)
enabled - Whether the item view should be enabled.void setCheckable(boolean checkable)
setChecked(boolean).checkable - Whether to display the checkbox or to hide itvoid setChecked(boolean checked)
setCheckable(boolean) for that.checked - Whether the checkbox should be checkedvoid setShortcut(boolean showShortcut,
char shortcutKey)
showShortcut - Whether a shortcut should be shown(if false, the value of
shortcutKey should be ignored).shortcutKey - The shortcut key that should be shown on the ItemView.void setIcon(android.graphics.drawable.Drawable icon)
icon - The icon of this item. null to hide the icon.boolean prefersCondensedTitle()
boolean showsIcon()
Copyright © 2011–2014. All rights reserved.