| Modifier and Type | Method and Description |
|---|---|
void |
addItem(String text,
String value,
boolean enabled)
Adds a new option to the list of options in the menu.
|
void |
addItemClickListener(Menu.ItemClickListener listener)
When an object needs to be notified upon a
MenuItem click, it must
be be registered to the Menu as an Menu.ItemClickListener . |
void |
clearMenu()
Remove all items from the menu.
|
int |
getItemCount()
Returns the items count in a menu.
|
String |
getItemText(int index)
return the text of the item located at the position provided as input.
|
String |
getValue(int index)
return the value of the item located at the position provided as input.
|
boolean |
isEnabled(int index)
Modify the enabled state of an item.
|
void |
setAnchor(MenuAnchor anchor)
Sets the position of the
Menu on the screen related to its
associated action button using one of the available anchoring options
provided by MenuAnchor. |
boolean |
setEnabled(int index,
boolean enabled)
Modify the enabled state of an item.
|
void setAnchor(MenuAnchor anchor)
Menu on the screen related to its
associated action button using one of the available anchoring options
provided by MenuAnchor.anchor - the requested Anchor position for the Menu .void clearMenu()
void addItem(String text, String value, boolean enabled)
text - The text to be displayedvalue - The value to be addedenabled - Defines whether the option can be chosen or not.void addItemClickListener(Menu.ItemClickListener listener)
MenuItem click, it must
be be registered to the Menu as an Menu.ItemClickListener .Menu.ItemClickListener interfaceMenuItem is
clicked inside Menu.ItemClickListener.onItemClicked(ItemClickEvent)Menu.addItemClickListener(ItemClickListener) to register
itself to the menu and receive click notificationslistener - The object to be notified when a MenuItem is clicked.Menu.ItemClickListenerint getItemCount()
String getItemText(int index)
index - the position of the itemString getValue(int index)
index - the position of the itemboolean setEnabled(int index,
boolean enabled)
index - the position of the item in the item list of the menuenabled - the state to be set for the itemtrue if the state was modified, false
otherwise.boolean isEnabled(int index)
index - the position of the item in the item list of the menutrue if the item is enabled, false
otherwise.Copyright © 2016 com.github.ilyes4j. All rights reserved.