summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Gluck <justin.gluck@livio.io>2019-07-24 16:01:56 -0400
committerJustin Gluck <justin.gluck@livio.io>2019-07-24 16:01:56 -0400
commitfa9f711f1f6e1d791e3a909b29c91557a062a710 (patch)
treea5f3afb29c6eeec6bd4aa482fe11e4fba24b32dd
parent71aef9c8bf1a123b3ed5a482362cfd0231c7e403 (diff)
downloadsdl_ios-fa9f711f1f6e1d791e3a909b29c91557a062a710.tar.gz
updating Choice Cells to include VR commands
-rw-r--r--Example Apps/Example ObjC/PerformInteractionManager.m17
-rw-r--r--Example Apps/Shared/AppConstants.h5
-rw-r--r--Example Apps/Shared/AppConstants.m5
3 files changed, 23 insertions, 4 deletions
diff --git a/Example Apps/Example ObjC/PerformInteractionManager.m b/Example Apps/Example ObjC/PerformInteractionManager.m
index ea4c42503..7826771d6 100644
--- a/Example Apps/Example ObjC/PerformInteractionManager.m
+++ b/Example Apps/Example ObjC/PerformInteractionManager.m
@@ -20,6 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (strong, nonatomic, readonly) SDLChoiceSet *choiceSet;
@property (copy, nonatomic, readonly) NSArray<SDLChoiceCell *> *cells;
+@property (copy, nonatomic, readonly) NSArray<SDLVRHelpItem *> *vrHelpList;
@end
@@ -39,17 +40,25 @@ NS_ASSUME_NONNULL_BEGIN
}
- (SDLChoiceSet *)choiceSet {
- return [[SDLChoiceSet alloc] initWithTitle:PICSInitialPrompt delegate:self layout:SDLChoiceSetLayoutList timeout:10 initialPromptString:PICSInitialPrompt timeoutPromptString:PICSTimeoutPrompt helpPromptString:PICSHelpPrompt vrHelpList:nil choices:self.cells];
+ return [[SDLChoiceSet alloc] initWithTitle:PICSInitialPrompt delegate:self layout:SDLChoiceSetLayoutList timeout:10 initialPromptString:PICSInitialPrompt timeoutPromptString:PICSTimeoutPrompt helpPromptString:PICSHelpPrompt vrHelpList:self.vrHelpList choices:self.cells];
}
- (NSArray<SDLChoiceCell *> *)cells {
- SDLChoiceCell *firstChoice = [[SDLChoiceCell alloc] initWithText:PICSFirstChoice artwork:[SDLArtwork artworkWithStaticIcon:SDLStaticIconNameKey] voiceCommands:nil];
- SDLChoiceCell *secondChoice = [[SDLChoiceCell alloc] initWithText:PICSSecondChoice];
- SDLChoiceCell *thirdChoice = [[SDLChoiceCell alloc] initWithText:PICSThirdChoice];
+ SDLChoiceCell *firstChoice = [[SDLChoiceCell alloc] initWithText:PICSFirstChoice artwork:[SDLArtwork artworkWithStaticIcon:SDLStaticIconNameKey] voiceCommands:@[VCPICSFirstChoice]];
+ SDLChoiceCell *secondChoice = [[SDLChoiceCell alloc] initWithText:PICSSecondChoice artwork:[SDLArtwork artworkWithStaticIcon:SDLStaticIconNameMicrophone] voiceCommands:@[VCPICSecondChoice]];
+ SDLChoiceCell *thirdChoice = [[SDLChoiceCell alloc] initWithText:PICSThirdChoice artwork:[SDLArtwork artworkWithStaticIcon:SDLStaticIconNameKey] voiceCommands:@[VCPICSThirdChoice]];
return @[firstChoice, secondChoice, thirdChoice];
}
+- (NSArray<SDLVRHelpItem *> *)vrHelpList {
+ SDLVRHelpItem *vrHelpListFirst = [[SDLVRHelpItem alloc] initWithText:VCPICSFirstChoice image:nil];
+ SDLVRHelpItem *vrHelpListSecond = [[SDLVRHelpItem alloc] initWithText:VCPICSecondChoice image:nil];
+ SDLVRHelpItem *vrHelpListThird = [[SDLVRHelpItem alloc] initWithText:VCPICSThirdChoice image:nil];
+
+ return @[vrHelpListFirst, vrHelpListSecond, vrHelpListThird];
+}
+
- (SDLInteractionMode)modeForTriggerSource:(SDLTriggerSource)source {
return ([source isEqualToEnum:SDLTriggerSourceMenu] ? SDLInteractionModeManualOnly : SDLInteractionModeVoiceRecognitionOnly);
}
diff --git a/Example Apps/Shared/AppConstants.h b/Example Apps/Shared/AppConstants.h
index 1c557c969..5c7b373e0 100644
--- a/Example Apps/Shared/AppConstants.h
+++ b/Example Apps/Shared/AppConstants.h
@@ -64,6 +64,11 @@ extern NSString * const PICSFirstChoice;
extern NSString * const PICSSecondChoice;
extern NSString * const PICSThirdChoice;
+#pragma mark - SDL Perform Interaction Choice Set Menu VR Commands
+extern NSString * const VCPICSFirstChoice;
+extern NSString * const VCPICSecondChoice;
+extern NSString * const VCPICSThirdChoice;
+
#pragma mark - SDL Add Command Menu
extern NSString * const ACSpeakAppNameMenuName;
extern NSString * const ACShowChoiceSetMenuName;
diff --git a/Example Apps/Shared/AppConstants.m b/Example Apps/Shared/AppConstants.m
index 7e81eba13..d6edd60c1 100644
--- a/Example Apps/Shared/AppConstants.m
+++ b/Example Apps/Shared/AppConstants.m
@@ -61,6 +61,11 @@ NSString * const PICSFirstChoice = @"First Choice";
NSString * const PICSSecondChoice = @"Second Choice";
NSString * const PICSThirdChoice = @"Third Choice";
+#pragma mark - SDL Perform Interaction Choice Set Menu VR Commands
+NSString * const VCPICSFirstChoice = @"First";
+NSString * const VCPICSecondChoice = @"Second";
+NSString * const VCPICSThirdChoice = @"Third";
+
#pragma mark - SDL Add Command Menu
NSString * const ACSpeakAppNameMenuName = @"Speak App Name";
NSString * const ACShowChoiceSetMenuName = @"Show Perform Interaction Choice Set";