public class ChoiceSetManager extends BaseSubManager
ERROR, internalInterface, LIMITED, READY, SETTING_UP, SHUTDOWN| Constructor and Description |
|---|
ChoiceSetManager(ISdl internalInterface,
FileManager fileManager)
Creates a new instance of the ChoiceSetManager
|
| Modifier and Type | Method and Description |
|---|---|
void |
deleteChoices(List<ChoiceCell> choices)
Deletes choices that were sent previously
|
void |
dismissKeyboard(Integer cancelID)
Cancels the keyboard-only interface if it is currently showing.
|
void |
dispose()
Called when manager is being torn down
|
HashSet<ChoiceCell> |
getPreloadedChoices() |
void |
preloadChoices(List<ChoiceCell> choices,
CompletionListener listener)
Preload choices to improve performance while presenting a choice set at a later time
|
void |
presentChoiceSet(ChoiceSet choiceSet,
InteractionMode mode,
KeyboardListener keyboardListener)
Presents a choice set
|
Integer |
presentKeyboard(String initialText,
KeyboardProperties customKeyboardConfig,
KeyboardListener listener)
Presents a keyboard on the Head unit to capture user input
|
void |
setKeyboardConfiguration(KeyboardProperties keyboardConfiguration)
Set a custom keyboard configuration for this session.
|
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 ChoiceSetManager(@NonNull
ISdl internalInterface,
@NonNull
FileManager fileManager)
internalInterface - 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()
BaseSubManagerCalled when manager is being torn down
dispose in class BaseSubManagerpublic void preloadChoices(@NonNull
List<ChoiceCell> choices,
@Nullable
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 deleteChoices(@NonNull
List<ChoiceCell> choices)
choices - - A list of ChoiceCell objectspublic void presentChoiceSet(@NonNull
ChoiceSet choiceSet,
@Nullable
InteractionMode mode,
@Nullable
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 Integer presentKeyboard(@NonNull String initialText, @Nullable KeyboardProperties customKeyboardConfig, @NonNull KeyboardListener listener)
initialText - - The initial text that is used as a placeholder text. It might not work on some head units.customKeyboardConfig - - the custom keyboard configuration to be used when the keyboard is displayedlistener - - A keyboard listener to capture user inputpublic void dismissKeyboard(@NonNull
Integer cancelID)
This will only dismiss an already presented keyboard if connected to head units running SDL 6.0+.
cancelID - - The unique ID assigned to the keyboard, passed as the return value from `presentKeyboard`public void setKeyboardConfiguration(@Nullable
KeyboardProperties keyboardConfiguration)
keyboardConfiguration - - the custom keyboard configuration to be used when the keyboard is displayedpublic HashSet<ChoiceCell> getPreloadedChoices()