public class ScreenManager extends BaseSubManager
Note: This class must be accessed through the SdlManager. Do not instantiate it by itself.
ERROR, internalInterface, LIMITED, READY, SETTING_UP, SHUTDOWN| Constructor and Description |
|---|
ScreenManager(ISdl internalInterface,
FileManager fileManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
addButtonListener(ButtonName buttonName,
OnButtonListener listener) |
void |
beginTransaction()
Begin a multiple updates transaction.
|
void |
changeLayout(TemplateConfiguration templateConfiguration,
CompletionListener listener)
Change the current layout to a new layout and optionally update the layout's night and day color schemes.
|
void |
commit(CompletionListener listener)
Pairs with beginTransaction() to batch text, graphic, and layout changes into a single update with a callback when the update is complete.
|
void |
deleteChoices(List<ChoiceCell> choices)
Deletes choices that were sent previously
|
void |
dismissKeyboard(Integer cancelID)
Dismisses a currently presented keyboard with the associated ID.
|
void |
dispose()
Called when manager is being torn down
|
DynamicMenuUpdatesMode |
getDynamicMenuUpdatesMode() |
String |
getMediaTrackTextField()
Get the current mediaTrackTextField value
|
List<MenuCell> |
getMenu()
The list of currently set menu cells
|
MenuConfiguration |
getMenuConfiguration()
The main menu layout.
|
HashSet<ChoiceCell> |
getPreloadedChoices() |
SdlArtwork |
getPrimaryGraphic()
Get the current primaryGraphic value
|
SdlArtwork |
getSecondaryGraphic()
Get the current secondaryGraphic value
|
SoftButtonObject |
getSoftButtonObjectById(int buttonId)
Get the SoftButtonObject that has the provided buttonId
|
SoftButtonObject |
getSoftButtonObjectByName(String name)
Get the SoftButtonObject that has the provided name
|
List<SoftButtonObject> |
getSoftButtonObjects()
Get the soft button objects list
|
TextAlignment |
getTextAlignment()
Get the alignment for the text fields
|
String |
getTextField1()
Get the current textField1 value
|
MetadataType |
getTextField1Type()
Get the metadata type for textField1
|
String |
getTextField2()
Get the current textField2 value
|
MetadataType |
getTextField2Type()
Get the metadata type for textField2
|
String |
getTextField3()
Get the current textField3 value
|
MetadataType |
getTextField3Type()
Get the metadata type for textField3
|
String |
getTextField4()
Get the current textField4 value
|
MetadataType |
getTextField4Type()
Get the metadata type for textField4
|
String |
getTitle()
Gets the title of the new template that will be displayed
|
List<VoiceCommand> |
getVoiceCommands()
Get the currently set voice commands
|
boolean |
openMenu()
Requires SDL RPC Version 6.0.0 or greater
Opens the Main Menu.
|
boolean |
openSubMenu(MenuCell cell)
Requires SDL RPC Version 6.0.0 or greater
Opens a subMenu.
|
void |
preloadChoices(List<ChoiceCell> choices,
CompletionListener listener)
Preload choices to improve performance while presenting a choice set at a later time
|
void |
presentAlert(AlertView alert,
AlertCompletionListener listener) |
void |
presentChoiceSet(ChoiceSet choiceSet,
InteractionMode mode)
Presents a choice set
|
Integer |
presentKeyboard(String initialText,
KeyboardProperties customKeyboardProperties,
KeyboardListener keyboardListener)
Presents a keyboard on the Head unit to capture user input
|
void |
presentSearchableChoiceSet(ChoiceSet choiceSet,
InteractionMode mode,
KeyboardListener keyboardListener)
Presents a searchable choice set
|
void |
removeButtonListener(ButtonName buttonName,
OnButtonListener listener) |
void |
setDynamicMenuUpdatesMode(DynamicMenuUpdatesMode value)
Sets the behavior of how menus are updated.
|
void |
setKeyboardConfiguration(KeyboardProperties keyboardConfiguration)
Set a custom keyboard configuration for this session.
|
void |
setMediaTrackTextField(String mediaTrackTextField)
Set the mediaTrackTextField on the head unit screen
|
void |
setMenu(List<MenuCell> menuCells)
Creates and sends all associated Menu RPCs
Note: the manager will store a deep copy the menuCells internally to be able to handle future updates correctly
|
void |
setMenuConfiguration(MenuConfiguration menuConfiguration)
The main menu layout.
|
void |
setPrimaryGraphic(SdlArtwork primaryGraphic)
Set the primaryGraphic on the head unit screen
|
void |
setSecondaryGraphic(SdlArtwork secondaryGraphic)
Set the secondaryGraphic on the head unit screen
|
void |
setSoftButtonObjects(List<SoftButtonObject> softButtonObjects)
Set softButtonObjects list and upload the images to the head unit
|
void |
setTextAlignment(TextAlignment textAlignment)
Set the alignment for the text fields
|
void |
setTextField1(String textField1)
The top text field within a template layout.
|
void |
setTextField1Type(MetadataType textField1Type)
Set the metadata type for the textField1
|
void |
setTextField2(String textField2)
Sets the second text field within a template layout.
|
void |
setTextField2Type(MetadataType textField2Type)
Set the metadata type for the textField2
|
void |
setTextField3(String textField3)
Sets the third text field within a template layout.
|
void |
setTextField3Type(MetadataType textField3Type)
Set the metadata type for the textField3
|
void |
setTextField4(String textField4)
Sets the fourth text field within a template layout.
|
void |
setTextField4Type(MetadataType textField4Type)
Set the metadata type for the textField4
|
void |
setTitle(String title)
Sets the title of the new template that will be displayed.
|
void |
setVoiceCommands(List<VoiceCommand> voiceCommands)
Set voice commands
|
void |
start(CompletionListener listener)
Starts up a BaseSubManager, and calls provided callback once BaseSubManager is done setting up or failed setup.
|
getState, handleTransportUpdated, onTransportUpdate, transitionToStatepublic ScreenManager(@NonNull
ISdl internalInterface,
@NonNull
FileManager fileManager)
public void start(CompletionListener listener)
BaseSubManagerstart in class BaseSubManagerlistener - CompletionListener that is called once the BaseSubManager's state is READY, LIMITED, or ERRORpublic void dispose()
Called when manager is being torn down
dispose in class BaseSubManagerpublic void setTextField1(String textField1)
If the system does not support a full 4 fields, this will automatically be concatenated and properly send the field available.
If 3 lines are available: [field1, field2, field3 - field 4]
If 2 lines are available: [field1 - field2, field3 - field4]
If 1 line is available: [field1 - field2 - field3 - field4]
textField1 - String value represents the textField1public String getTextField1()
public void setTextField2(String textField2)
If the system does not support a full 4 fields, this will automatically be concatenated and properly send the field available.
If 3 lines are available: [field1, field2, field3 - field 4]
If 2 lines are available: [field1 - field2, field3 - field4]
If 1 line is available: [field1 - field2 - field3 - field4]
textField2 - String value represents the textField1public String getTextField2()
public void setTextField3(String textField3)
If the system does not support a full 4 fields, this will automatically be concatenated and properly send the field available.
If 3 lines are available: [field1, field2, field3 - field 4]
If 2 lines are available: [field1 - field2, field3 - field4]
If 1 line is available: [field1 - field2 - field3 - field4]
textField3 - String value represents the textField1public String getTextField3()
public void setTextField4(String textField4)
If the system does not support a full 4 fields, this will automatically be concatenated and properly send the field available.
If 3 lines are available: [field1, field2, field3 - field 4]
If 2 lines are available: [field1 - field2, field3 - field4]
If 1 line is available: [field1 - field2 - field3 - field4]
textField4 - String value represents the textField1public String getTextField4()
public void setMediaTrackTextField(String mediaTrackTextField)
mediaTrackTextField - String value represents the mediaTrackTextFieldpublic String getMediaTrackTextField()
public void setPrimaryGraphic(SdlArtwork primaryGraphic)
primaryGraphic - an SdlArtwork object represents the primaryGraphicpublic SdlArtwork getPrimaryGraphic()
public void setSecondaryGraphic(SdlArtwork secondaryGraphic)
secondaryGraphic - an SdlArtwork object represents the secondaryGraphicpublic SdlArtwork getSecondaryGraphic()
public void setTextAlignment(TextAlignment textAlignment)
textAlignment - TextAlignment value represents the alignment for the text fieldspublic TextAlignment getTextAlignment()
public void setTextField1Type(MetadataType textField1Type)
textField1Type - a MetadataType value represents the metadata for textField1public MetadataType getTextField1Type()
public void setTextField2Type(MetadataType textField2Type)
textField2Type - a MetadataType value represents the metadata for textField2public MetadataType getTextField2Type()
public void setTextField3Type(MetadataType textField3Type)
textField3Type - a MetadataType value represents the metadata for textField3public MetadataType getTextField3Type()
public void setTextField4Type(MetadataType textField4Type)
textField4Type - a MetadataType value represents the metadata for textField4public MetadataType getTextField4Type()
public void setTitle(String title)
title - the title of the new template that will be displayed. MaxLength: 100.public String getTitle()
public void changeLayout(@NonNull
TemplateConfiguration templateConfiguration,
CompletionListener listener)
If you are connected on a < v6.0 connection and batching the update, the layout will be updated, then the text and graphics will be updated. If you are connected on a >= v6.0 connection, the layout will be updated at the same time that the text and graphics are updated.
If this update is batched between beginTransaction and commit, the completionListener here will not be called. Use the completionListener with commit(completionListener)
NOTE: If this update returns an false, it may have been superseded by another update. This means that it was cancelled while in-progress because another update was requested, whether batched or not.
templateConfiguration - The new configuration of the template, including the layout and color scheme.listener - A listener that will be called when the layout change finished.public void setSoftButtonObjects(@NonNull
List<SoftButtonObject> softButtonObjects)
softButtonObjects - the list of the SoftButtonObject values that should be displayed on the head unitpublic List<SoftButtonObject> getSoftButtonObjects()
public SoftButtonObject getSoftButtonObjectByName(@NonNull String name)
name - a String value that represents the namepublic SoftButtonObject getSoftButtonObjectById(int buttonId)
buttonId - a int value that represents the id of the buttonpublic List<VoiceCommand> getVoiceCommands()
public void setVoiceCommands(@NonNull
List<VoiceCommand> voiceCommands)
voiceCommands - the voice commands to be sent to the head unitpublic List<MenuCell> getMenu()
public void setMenu(@NonNull
List<MenuCell> menuCells)
menuCells - - the menu cells that are to be sent to the head unit, including their sub-cells.public void setDynamicMenuUpdatesMode(@NonNull
DynamicMenuUpdatesMode value)
DynamicMenuUpdatesModevalue - - the update modepublic DynamicMenuUpdatesMode getDynamicMenuUpdatesMode()
public boolean openMenu()
public boolean openSubMenu(@NonNull
MenuCell cell)
MenuCell(String,SdlArtwork,List)cell - - A SubMenu cell whose sub menu you wish to openpublic void setMenuConfiguration(@NonNull
MenuConfiguration menuConfiguration)
menuConfiguration - - The default menuConfigurationpublic MenuConfiguration getMenuConfiguration()
public void deleteChoices(@NonNull
List<ChoiceCell> choices)
choices - - A list of ChoiceCell objectspublic void preloadChoices(@NonNull
List<ChoiceCell> choices,
CompletionListener listener)
choices - - a list of ChoiceCell objects that will be part of a choice set laterlistener - - a completion listener to inform when the operation is completepublic void presentSearchableChoiceSet(@NonNull
ChoiceSet choiceSet,
@Nullable
InteractionMode mode,
@NonNull
KeyboardListener keyboardListener)
choiceSet - - The choice set to be presented. This can include Choice Cells that were preloaded or notmode - - The intended interaction modekeyboardListener - - A keyboard listener to capture user inputpublic void presentChoiceSet(@NonNull
ChoiceSet choiceSet,
@Nullable
InteractionMode mode)
choiceSet - - The choice set to be presented. This can include Choice Cells that were preloaded or notmode - - The intended interaction modepublic Integer presentKeyboard(@NonNull String initialText, @Nullable KeyboardProperties customKeyboardProperties, @NonNull KeyboardListener keyboardListener)
initialText - - The initial text that is used as a placeholder text. It might not work on some head units.customKeyboardProperties - - the custom keyboard configuration to be used when the keyboard is displayedkeyboardListener - - A keyboard listener to capture user inputpublic void setKeyboardConfiguration(@Nullable
KeyboardProperties keyboardConfiguration)
keyboardConfiguration - - the custom keyboard configuration to be used when the keyboard is displayedpublic HashSet<ChoiceCell> getPreloadedChoices()
public void dismissKeyboard(@NonNull
Integer cancelID)
cancelID - The unique ID assigned to the keyboardpublic void beginTransaction()
public void commit(CompletionListener listener)
listener - a CompletionListener that has a callback that will be called when the updates are finishedpublic void addButtonListener(@NonNull
ButtonName buttonName,
@NonNull
OnButtonListener listener)
public void removeButtonListener(@NonNull
ButtonName buttonName,
@NonNull
OnButtonListener listener)
public void presentAlert(AlertView alert, AlertCompletionListener listener)