public class

SubMenu

extends MenuItem
java.lang.Object
   ↳ com.neomades.ui.menu.MenuItem
     ↳ com.neomades.ui.menu.SubMenu

Class Overview

A MenuItem which contains other menu items.

Menu items contained in the SubMenu are usually displayed in a dialog that appears when clicking on the SubMenu item itself.

Sub menus do not support nested sub menus.

Cross Platform Considerations

In Android, menu items inside sub menus can not display images if the Android version is lower than 4.0.

In iOS, menu items inside sub menus can not display images. Be sure to set a text.

Summary

[Expand]
Inherited Constants
From class com.neomades.ui.menu.MenuItem
Public Constructors
SubMenu(Image img)
Constructs a SubMenu with the image given in parameter.
SubMenu(int textId)
Constructs a SubMenu with the text of the id given in parameter.
SubMenu(int textId, int imageId)
Constructs a SubMenu with the text and the image of the ids given in parameter.
SubMenu(String text)
Constructs a SubMenu with the text given in parameter.
SubMenu(String text, Image img)
Constructs an item with the text and the image given in parameter.
Public Methods
void addItem(MenuItem item)
Adds a menu item to the SubMenu.
[Expand]
Inherited Methods
From class com.neomades.ui.menu.MenuItem
From class java.lang.Object

Public Constructors

public SubMenu (Image img)

Constructs a SubMenu with the image given in parameter.

From Android 4.0, the image will not be displayed when used as a classic SubMenu. Use it as a left or right action instead.

Parameters
img the image of the sub menu

public SubMenu (int textId)

Constructs a SubMenu with the text of the id given in parameter.

Parameters
textId the id of the text

public SubMenu (int textId, int imageId)

Constructs a SubMenu with the text and the image of the ids given in parameter.

From Android 4.0, the image will not be displayed when used as a classic SubMenu. Use it as a left or right action instead.

Parameters
textId the id of the text
imageId the id of the image

public SubMenu (String text)

Constructs a SubMenu with the text given in parameter.

Parameters
text the text of the sub menu

public SubMenu (String text, Image img)

Constructs an item with the text and the image given in parameter.

From Android 4.0, the image will not be displayed when used as a classic SubMenu. Use it as a left or right action instead.

Parameters
text the text of the sub menu
img the image of the sub menu

Public Methods

public void addItem (MenuItem item)

Adds a menu item to the SubMenu.

Parameters
item the item to add