Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Documentation
Sidebar

Class MenuCell

Hierarchy

java.lang.Object

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

Constructors

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

Creates a new MenuCell Object with multiple parameters set

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

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

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

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,SdlArtwork icon,java.util.List<com.smartdevicelink.managers.screen.menu.MenuCell> subCells)

Parameters

title
The cell's primary text
icon
The cell's 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)

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)

Parameters

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

getIcon()

Gets the icon for the cell

public 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)

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)

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)

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()

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, but does NOT compare the listener objects

public boolean equals(Object o)

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