public class RoboMenu extends Object implements Menu
Robolectric implementation of Menu
.
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, SUPPORTED_MODIFIERS_MASK, USER_MASK, USER_SHIFT
Modifier and Type | Method and Description |
---|---|
MenuItem |
add(CharSequence title) |
MenuItem |
add(int titleRes) |
MenuItem |
add(int groupId,
int itemId,
int order,
CharSequence title) |
MenuItem |
add(int groupId,
int itemId,
int order,
int titleRes) |
int |
addIntentOptions(int groupId,
int itemId,
int order,
ComponentName caller,
Intent[] specifics,
Intent intent,
int flags,
MenuItem[] outSpecificItems) |
SubMenu |
addSubMenu(CharSequence title) |
SubMenu |
addSubMenu(int titleRes) |
SubMenu |
addSubMenu(int groupId,
int itemId,
int order,
CharSequence title) |
SubMenu |
addSubMenu(int groupId,
int itemId,
int order,
int titleRes) |
void |
clear() |
void |
close() |
MenuItem |
findItem(int id) |
RoboMenuItem |
findMenuItem(CharSequence title) |
RoboMenuItem |
findMenuItemContaining(CharSequence desiredText) |
MenuItem |
getItem(int index) |
boolean |
hasVisibleItems() |
boolean |
isShortcutKey(int keyCode,
KeyEvent event) |
boolean |
performIdentifierAction(int id,
int flags) |
boolean |
performShortcut(int keyCode,
KeyEvent event,
int flags) |
void |
removeGroup(int groupId) |
void |
removeItem(int id) |
void |
setGroupCheckable(int group,
boolean checkable,
boolean exclusive) |
void |
setGroupEnabled(int group,
boolean enabled) |
void |
setGroupVisible(int group,
boolean visible) |
void |
setQwertyMode(boolean isQwerty) |
int |
size() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setGroupDividerEnabled
public RoboMenu()
public RoboMenu(Context context)
public MenuItem add(CharSequence title)
public MenuItem add(int groupId, int itemId, int order, CharSequence title)
public MenuItem add(int groupId, int itemId, int order, int titleRes)
public SubMenu addSubMenu(CharSequence title)
addSubMenu
in interface Menu
public SubMenu addSubMenu(int titleRes)
addSubMenu
in interface Menu
public SubMenu addSubMenu(int groupId, int itemId, int order, CharSequence title)
addSubMenu
in interface Menu
public SubMenu addSubMenu(int groupId, int itemId, int order, int titleRes)
addSubMenu
in interface Menu
public int addIntentOptions(int groupId, int itemId, int order, ComponentName caller, Intent[] specifics, Intent intent, int flags, MenuItem[] outSpecificItems)
addIntentOptions
in interface Menu
public void removeItem(int id)
removeItem
in interface Menu
public void removeGroup(int groupId)
removeGroup
in interface Menu
public void setGroupCheckable(int group, boolean checkable, boolean exclusive)
setGroupCheckable
in interface Menu
public void setGroupVisible(int group, boolean visible)
setGroupVisible
in interface Menu
public void setGroupEnabled(int group, boolean enabled)
setGroupEnabled
in interface Menu
public boolean hasVisibleItems()
hasVisibleItems
in interface Menu
public boolean performShortcut(int keyCode, KeyEvent event, int flags)
performShortcut
in interface Menu
public boolean isShortcutKey(int keyCode, KeyEvent event)
isShortcutKey
in interface Menu
public boolean performIdentifierAction(int id, int flags)
performIdentifierAction
in interface Menu
public void setQwertyMode(boolean isQwerty)
setQwertyMode
in interface Menu
public RoboMenuItem findMenuItem(CharSequence title)
public RoboMenuItem findMenuItemContaining(CharSequence desiredText)