Skip to content

Commit 2d0478e

Browse files
committed
Merge branch 'develop'
2 parents 122e3e1 + 01e7cce commit 2d0478e

File tree

2 files changed

+23
-32
lines changed

2 files changed

+23
-32
lines changed

Podfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
PODS:
2-
- BiSON (1.2.2)
3-
- SmartDeviceLink (7.1.1):
2+
- BiSON (1.2.5)
3+
- SmartDeviceLink (7.2.0):
44
- BiSON (~> 1.2)
5-
- SmartDeviceLink/Default (= 7.1.1)
6-
- SmartDeviceLink/Default (7.1.1):
5+
- SmartDeviceLink/Default (= 7.2.0)
6+
- SmartDeviceLink/Default (7.2.0):
77
- BiSON (~> 1.2)
88

99
DEPENDENCIES:
@@ -15,8 +15,8 @@ SPEC REPOS:
1515
- SmartDeviceLink
1616

1717
SPEC CHECKSUMS:
18-
BiSON: efb26805ec99f4ad516b77e9a32ced05f1c0985d
19-
SmartDeviceLink: 9f00196ee6b4fc2f9bd2e8321de2b47a1258109e
18+
BiSON: 232dc4fdbe825301742963f27a78f10f13bca68b
19+
SmartDeviceLink: 9fa89b2d7eff9f7abe7e40fe609f57b06f8b73da
2020

2121
PODFILE CHECKSUM: 6458ae1192665bc1781ad13cb2576fa31d74fc25
2222

SmartDeviceLinkService.m

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ - (void)hmiLevel:(SDLHMILevel)oldLevel didChangeToLevel:(SDLHMILevel)newLevel {
137137
// check current HMI level of the app
138138
if ([SDLHMILevelFull isEqualToEnum:newLevel] && !self.hasFirstHMIFullOccurred) {
139139
self.firstHMIFullOccurred = YES;
140-
// the app is just started by the user. Send everything needed to be done once
141-
[self sendWelcomeMessageWithSpeak:YES];
140+
// The app is just started by the user. Send everything needed to be done once and start on the current weather screen
141+
[self sendWeatherConditions:[WeatherDataManager sharedManager].weatherConditions withSpeak:YES firstWindow:YES];
142142
[self sendDefaultGlobalProperties];
143143
[self preloadChangeUnitsChoices];
144144

@@ -215,7 +215,7 @@ - (void)handleWeatherDataUpdate:(NSNotification *)notification {
215215
MWInfoType infoType = self.currentInfoType;
216216
if ([MWInfoTypeWeatherConditions isEqualToString:infoType]) {
217217
WeatherConditions *conditions = notification.userInfo[@"weatherConditions"];
218-
[self sendWeatherConditions:conditions withSpeak:NO];
218+
[self sendWeatherConditions:conditions withSpeak:NO firstWindow:NO];
219219
} else if ([MWInfoTypeDailyForecast isEqualToString:infoType]) {
220220
NSArray *forecast = notification.userInfo[@"dailyForecast"];
221221
[self sendForecastList:forecast infoType:infoType withSpeak:NO];
@@ -299,24 +299,7 @@ - (void)presentForecastInteractionWithList:(NSArray *)forecasts ofType:(MWInfoTy
299299

300300
#pragma mark - Template updates
301301

302-
- (void)sendWelcomeMessageWithSpeak:(BOOL)withSpeak {
303-
self.currentInfoType = MWInfoTypeNone;
304-
[self.manager.screenManager beginUpdates];
305-
self.manager.screenManager.textField1 = self.localization[@"show.welcome.field1"];
306-
self.manager.screenManager.textField2 = self.localization[@"show.welcome.field2"];
307-
self.manager.screenManager.textField3 = self.localization[@"show.welcome.field3"];
308-
self.manager.screenManager.textField4 = self.localization[@"show.welcome.field4"];
309-
self.manager.screenManager.textAlignment = SDLTextAlignmentCenter;
310-
self.manager.screenManager.softButtonObjects = [self buildDefaultSoftButtons];
311-
[self.manager.screenManager endUpdatesWithCompletionHandler:nil];
312-
313-
if (withSpeak) {
314-
SDLSpeak *speak = [[SDLSpeak alloc] initWithTTS:self.localization[@"speak.welcome"]];
315-
[self.manager sendRequest:speak];
316-
}
317-
}
318-
319-
- (void)sendWeatherConditions:(WeatherConditions *)conditions withSpeak:(BOOL)withSpeak {
302+
- (void)sendWeatherConditions:(WeatherConditions *)conditions withSpeak:(BOOL)withSpeak firstWindow:(BOOL)firstWindow {
320303
if (conditions == nil) {
321304
SDLAlertView *alertRequest = [[SDLAlertView alloc] initWithText:self.localization[@"alert.no-conditions.field1"] secondaryText:self.localization[@"alert.no-conditions.field2"] tertiaryText:nil timeout:@(10) showWaitIndicator:nil audioIndication:[[SDLAlertAudioData alloc] initWithSpeechSynthesizerString:self.localization[@"alert.no-forecast.prompt"]] buttons:nil icon:nil];
322305
[self.manager.screenManager presentAlert:alertRequest withCompletionHandler:nil];
@@ -353,7 +336,15 @@ - (void)sendWeatherConditions:(WeatherConditions *)conditions withSpeak:(BOOL)wi
353336
[self.manager.screenManager endUpdatesWithCompletionHandler:nil];
354337

355338
if (withSpeak) {
356-
SDLSpeak *speakRequest = [[SDLSpeak alloc] initWithTTS:[self.localization stringForKey:@"conditions.speak", conditions.conditionTitle, [conditions.temperature stringValueForUnit:temperatureType shortened:NO localization:self.localization], [conditions.humidity stringValueForUnit:percentageType shortened:NO localization:self.localization], [conditions.windSpeed stringValueForUnit:speedType shortened:NO localization:self.localization]]];
339+
SDLSpeak *speakRequest;
340+
SDLTTSChunk *welcomeTTS = [[SDLTTSChunk alloc] initWithText:self.localization[@"speak.welcome"] type: SDLSpeechCapabilitiesText];
341+
SDLTTSChunk *weatherConditionTTS = [[SDLTTSChunk alloc] initWithText:[self.localization stringForKey:@"conditions.speak", conditions.conditionTitle, [conditions.temperature stringValueForUnit:temperatureType shortened:NO localization:self.localization], [conditions.humidity stringValueForUnit:percentageType shortened:NO localization:self.localization], [conditions.windSpeed stringValueForUnit:speedType shortened:NO localization:self.localization]] type:SDLSpeechCapabilitiesText];
342+
if (firstWindow) {
343+
speakRequest = [[SDLSpeak alloc] initWithTTSChunks:@[welcomeTTS, weatherConditionTTS]];
344+
} else {
345+
speakRequest = [[SDLSpeak alloc] initWithTTSChunks:@[weatherConditionTTS]];
346+
}
347+
357348
[self.manager sendRequest:speakRequest];
358349
}
359350
}
@@ -593,7 +584,7 @@ - (void)closeListInfoType:(MWInfoType)infoType {
593584
[self setCurrentInfoTypeList:nil];
594585
self.currentInfoTypeListIndex = -1;
595586

596-
[self sendWelcomeMessageWithSpeak:NO];
587+
[self sendWeatherConditions:[WeatherDataManager sharedManager].weatherConditions withSpeak:NO firstWindow:NO];
597588
[self sendDefaultGlobalProperties];
598589

599590
self.manager.screenManager.menu = [self weatherMenuCells];
@@ -602,7 +593,7 @@ - (void)closeListInfoType:(MWInfoType)infoType {
602593
- (void)repeatWeatherInformation {
603594
MWInfoType infoType = self.currentInfoType;
604595
if ([MWInfoTypeWeatherConditions isEqualToString:infoType]) {
605-
[self sendWeatherConditions:[WeatherDataManager sharedManager].weatherConditions withSpeak:YES];
596+
[self sendWeatherConditions:[WeatherDataManager sharedManager].weatherConditions withSpeak:YES firstWindow:NO];
606597
} else if ([MWInfoTypeDailyForecast isEqualToString:infoType] || [MWInfoTypeHourlyForecast isEqualToString:infoType]) {
607598
[self showForecastAtIndex:self.currentInfoTypeListIndex fromList:self.currentInfoTypeList infoType:infoType withSpeak:YES];
608599
} else if ([MWInfoTypeAlerts isEqualToString:infoType]) {
@@ -620,7 +611,7 @@ - (void)repeatWeatherInformation {
620611
return;
621612
}
622613

623-
[weakSelf sendWeatherConditions:[WeatherDataManager sharedManager].weatherConditions withSpeak:YES];
614+
[weakSelf sendWeatherConditions:[WeatherDataManager sharedManager].weatherConditions withSpeak:YES firstWindow:NO];
624615
}];
625616

626617
SDLSoftButtonState *dailyForecastState = [[SDLSoftButtonState alloc] initWithStateName:@"state" text:self.localization[@"sb.daily"] image:[[UIImage imageNamed:@"menu-day"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]];
@@ -722,7 +713,7 @@ - (void)repeatWeatherInformation {
722713
- (NSArray<SDLMenuCell *> *)weatherMenuCells {
723714
__weak typeof(self) weakSelf = self;
724715
SDLMenuCell *showWeatherConditions = [[SDLMenuCell alloc] initWithTitle:self.localization[@"cmd.current-conditions"] secondaryText:nil tertiaryText:nil icon:[[SDLArtwork alloc] initWithImage:[[UIImage imageNamed:@"clear-day"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] persistent:YES asImageFormat:SDLArtworkImageFormatPNG] secondaryArtwork:nil voiceCommands:@[self.localization[@"vr.current"],self.localization[@"vr.conditions"], self.localization[@"vr.current-conditions"], self.localization[@"vr.show-conditions"], self.localization[@"vr.show-current-conditions"]] handler:^(SDLTriggerSource _Nonnull triggerSource) {
725-
[weakSelf sendWeatherConditions:[WeatherDataManager sharedManager].weatherConditions withSpeak:YES];
716+
[weakSelf sendWeatherConditions:[WeatherDataManager sharedManager].weatherConditions withSpeak:YES firstWindow:NO];
726717
}];
727718

728719
SDLMenuCell *showDailyForecast = [[SDLMenuCell alloc] initWithTitle:self.localization[@"cmd.daily-forecast"] secondaryText:nil tertiaryText:nil icon:[[SDLArtwork alloc] initWithImage:[[UIImage imageNamed:@"menu-day"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] persistent:YES asImageFormat:SDLArtworkImageFormatPNG] secondaryArtwork:nil voiceCommands:@[self.localization[@"vr.daily"], self.localization[@"vr.daily-forecast"], self.localization[@"vr.show-daily-forecast"]] handler:^(SDLTriggerSource _Nonnull triggerSource) {

0 commit comments

Comments
 (0)