Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
Android Documentation
MenuCell

Class MenuCell

Hierarchy

java.lang.Object

Package
com.smartdevicelink.managers.screen.menu
All Implemented Interfaces
java.lang.Cloneable

Constructors

Creates a new MenuCell Object with multiple parameters set

public MenuCell(String title,SdlArtwork icon,java.util.List<java.lang.String> voiceCommands,MenuSelectionListener listener)

Constructor Parameters

title
The cell's primary text
icon
The cell's image
voiceCommands
Voice commands that will activate the menu cell
listener
Calls the code that will be run when the menu cell is selected

Creates a new MenuCell Object with multiple parameters and optional fields set

public MenuCell(String title,String secondaryText,String tertiaryText,SdlArtwork icon,SdlArtwork secondaryArtwork,java.util.List<java.lang.String> voiceCommands,MenuSelectionListener listener)

Constructor Parameters

title
The cell's primary text
secondaryText
The cell's secondary text
tertiaryText
The cell's tertiary text
icon
The cell's image
secondaryArtwork
The cell's secondary image
voiceCommands
Voice commands that will activate the menu cell
listener
Calls the code that will be run when the menu cell is selected

Creates a new MenuCell Object with multiple parameters set NOTE: because this has sub-cells, there does not need to be a listener

public MenuCell(String title,MenuLayout subMenuLayout,SdlArtwork icon,java.util.List<com.smartdevicelink.managers.screen.menu.MenuCell> subCells)

Constructor Parameters

title
The cell's primary text
subMenuLayout
The submenu's layout that the subCells will be shown in. If `null`, the default submenu layout in the screen manager's `MenuConfiguration` will be used.
icon
The cell's image
subCells
The sub-cells for the sub menu that will appear when the cell is selected

Creates a new MenuCell Object with multiple parameters and optional fields set NOTE: because this has sub-cells, there does not need to be a listener

public MenuCell(String title,String secondaryText,String tertiaryText,MenuLayout subMenuLayout,SdlArtwork icon,SdlArtwork secondaryArtwork,java.util.List<com.smartdevicelink.managers.screen.menu.MenuCell> subCells)

Constructor Parameters

title
The cell's primary text
secondaryText
The cell's secondary text
tertiaryText
The cell's tertiary text
subMenuLayout
The submenu's layout that the subCells will be shown in. If `null`, the default submenu layout in the screen manager's `MenuConfiguration` will be used.
icon
The cell's image
secondaryArtwork
The cell's secondary image
subCells
The sub-cells for the sub menu that will appear when the cell is selected

Methods

setTitle( String title )

Sets the title of the menu cell

public void setTitle(String title)

Method Parameters

title
- the title of the cell. Required

getTitle()

Gets the title of the menu cell

public java.lang.String getTitle()

setIcon( SdlArtwork icon )

Sets the icon of the menu cell

public void setIcon(SdlArtwork icon)

Method Parameters

icon
- the icon being set, of type {@link SdlArtwork}

getIcon()

Gets the icon for the cell

public com.smartdevicelink.managers.file.filetypes.SdlArtwork getIcon()

setVoiceCommands( java.util.List<java.lang.String> voiceCommands )

A list of Strings that will be used for voice commands

public void setVoiceCommands(java.util.List<java.lang.String> voiceCommands)

Method Parameters

voiceCommands
- the string list used by the IVI system for voice commands

getVoiceCommands()

the string list used by the IVI system for voice commands

public java.util.List getVoiceCommands()

setSubCells( java.util.List<com.smartdevicelink.managers.screen.menu.MenuCell> subCells )

The list of MenuCells that can be set as subCells

public void setSubCells(java.util.List<com.smartdevicelink.managers.screen.menu.MenuCell> subCells)

Method Parameters

subCells
- the list of subCells for this menu item

getSubCells()

The list of subCells for this menu item

public java.util.List getSubCells()

setMenuSelectionListener( MenuSelectionListener menuSelectionListener )

The listener for when a menu item is selected

public void setMenuSelectionListener(MenuSelectionListener menuSelectionListener)

Method Parameters

menuSelectionListener
the listener for this menuCell object

getMenuSelectionListener()

The listener that gets triggered when the menuCell object is selected

public com.smartdevicelink.managers.screen.menu.MenuSelectionListener getMenuSelectionListener()

setSubMenuLayout( MenuLayout subMenuLayout )

The submenu's layout that the subCells will be shown in. If `null`, the default submenu layout set via the screen manager's `MenuConfiguration` will be used.

public void setSubMenuLayout(MenuLayout subMenuLayout)

Method Parameters

subMenuLayout
- the layout used for the sub menu

getSubMenuLayout()

The submenu's layout that the subCells will be shown in. If `null`, the default submenu layout set via the screen manager's `MenuConfiguration` will be used.

public com.smartdevicelink.proxy.rpc.enums.MenuLayout getSubMenuLayout()

setSecondaryText( String secondaryText )

Sets the secondaryText

public void setSecondaryText(String secondaryText)

Method Parameters

secondaryText
the cell's secondaryText

getSecondaryText()

Get the cell's secondaryText

public java.lang.String getSecondaryText()

setTertiaryText( String tertiaryText )

Sets the tertiaryText

public void setTertiaryText(String tertiaryText)

Method Parameters

tertiaryText
the cell's tertiaryText

getTertiaryText()

Get the cell's tertiaryText

public java.lang.String getTertiaryText()

setSecondaryArtwork( SdlArtwork secondaryArtwork )

Sets the secondaryArtwork

public void setSecondaryArtwork(SdlArtwork secondaryArtwork)

Method Parameters

secondaryArtwork
the cell's secondaryArtwork

getSecondaryArtwork()

Get the cell's secondaryArtwork

public com.smartdevicelink.managers.file.filetypes.SdlArtwork getSecondaryArtwork()

hashCode()

Note: You should compare using the {@link #equals(Object)} method.
Hash the parameters of the object and return the result for comparison For each param, increase the rotation distance by one. It is necessary to rotate each of our properties because a simple bitwise OR will produce equivalent results if, for example: Object 1: getText() = "Hi", getSecondaryText() = "Hello" Object 2: getText() = "Hello", getSecondaryText() = "Hi"

public int hashCode()

equals( Object o )

Uses our custom hashCode for MenuCell objects

public boolean equals(Object o)

Method Parameters

o
- The object to compare

clone()

Creates a deep copy of the object

public com.smartdevicelink.managers.screen.menu.MenuCell clone()

Inherited Methods

From Class Methods
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section