@@ -282,7 +282,8 @@ - (void)presentForecastInteractionWithList:(NSArray *)forecasts ofType:(MWInfoTy
282
282
}
283
283
}
284
284
285
- SDLChoiceCell *cell = [[SDLChoiceCell alloc ] initWithText: [dateFormatShow stringFromDate: forecast.date] artwork: [SDLArtwork artworkWithImage: [[[ImageProcessor sharedProcessor ] imageFromConditionImage: forecast.conditionIcon] imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate] asImageFormat: SDLArtworkImageFormatPNG] voiceCommands: [vrCommands copy ]];
285
+ NSString *precipitationChanceString = [NSString stringWithFormat: @" Precipitation chance: %@ " , [forecast.precipitationChance stringValueForUnit: UnitPercentageDefault shortened: YES localization: self .localization]];
286
+ SDLChoiceCell *cell = [[SDLChoiceCell alloc ] initWithText: [dateFormatShow stringFromDate: forecast.date] secondaryText: precipitationChanceString tertiaryText: nil voiceCommands: [vrCommands copy ] artwork: [SDLArtwork artworkWithImage: [[[ImageProcessor sharedProcessor ] imageFromConditionImage: forecast.conditionIcon] imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate] asImageFormat: SDLArtworkImageFormatPNG] secondaryArtwork: nil ];
286
287
[choices addObject: cell];
287
288
}
288
289
@@ -318,8 +319,8 @@ - (void)sendWelcomeMessageWithSpeak:(BOOL)withSpeak {
318
319
319
320
- (void )sendWeatherConditions : (WeatherConditions *)conditions withSpeak : (BOOL )withSpeak {
320
321
if (conditions == nil ) {
321
- SDLAlert *alertRequest = [[SDLAlert alloc ] initWithAlertText1 :self .localization[@" alert.no-conditions.field1" ] alertText2 :self .localization[@" alert.no-conditions.field2" ] alertText3 :nil softButtons: nil playTone: NO ttsChunks :self .localization[@" alert.no-forecast.prompt" ] duration: 10000 progressIndicator: NO alertIcon: nil cancelID: 0 ];
322
- [self .manager sendRequest : alertRequest];
322
+ 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 ];
323
+ [self .manager.screenManager presentAlert : alertRequest withCompletionHandler: nil ];
323
324
}
324
325
325
326
self.currentInfoType = MWInfoTypeWeatherConditions;
@@ -360,8 +361,8 @@ - (void)sendWeatherConditions:(WeatherConditions *)conditions withSpeak:(BOOL)wi
360
361
361
362
- (void )sendForecastList : (NSArray *)forecasts infoType : (MWInfoType)infoType withSpeak : (BOOL )withSpeak {
362
363
if (forecasts == nil || forecasts.count == 0 ) {
363
- SDLAlert *alertRequest = [[SDLAlert alloc ] initWithAlertText1 :self .localization[@" alert.no-forecast.field1" ] alertText2 :self .localization[@" alert.no-forecast.field2" ] alertText3 :nil softButtons: nil playTone: NO ttsChunks :self .localization[@" alert.no-forecast.prompt" ] duration: 10000 progressIndicator: NO alertIcon: nil cancelID: 0 ];
364
- [self .manager sendRequest : alertRequest];
364
+ SDLAlertView *alertRequest = [[SDLAlertView alloc ] initWithText :self .localization[@" alert.no-forecast.field1" ] secondaryText :self .localization[@" alert.no-forecast.field2" ] tertiaryText :nil timeout: @( 10 ) showWaitIndicator: nil audioIndication: [[SDLAlertAudioData alloc ] initWithSpeechSynthesizerString :self .localization[@" alert.no-forecast.prompt" ]] buttons: nil icon: nil ];
365
+ [self .manager.screenManager presentAlert : alertRequest withCompletionHandler: nil ];
365
366
}
366
367
367
368
if ([infoType isEqualToString: MWInfoTypeDailyForecast]) {
@@ -513,8 +514,10 @@ - (void)showForecastAtIndex:(NSUInteger)index fromList:(NSArray<Forecast *> *)fo
513
514
514
515
- (void )sendAlertList : (NSArray *)alerts withSpeak : (BOOL )withSpeak {
515
516
if (alerts.count == 0 ) {
516
- SDLAlert *alertRequest = [[SDLAlert alloc ] initWithAlertText1: self .localization[@" alert.no-alerts.field1" ] alertText2: self .localization[@" alert.no-alerts.field2" ] alertText3: nil softButtons: nil playTone: NO ttsChunks: self .localization[@" alert.no-alerts.prompt" ] duration: 10000 progressIndicator: NO alertIcon: nil cancelID: 0 ];
517
- [self .manager sendRequest: alertRequest];
517
+ SDLAlertView *alertRequest = [[SDLAlertView alloc ] initWithText: self .localization[@" alert.no-alerts.field1" ] secondaryText: self .localization[@" alert.no-alerts.field2" ] tertiaryText: nil timeout: @(4 ) showWaitIndicator: nil audioIndication: [[SDLAlertAudioData alloc ] initWithSpeechSynthesizerString: self .localization[@" alert.no-alerts.prompt" ]] buttons: nil icon: nil ];
518
+
519
+ [self .manager.screenManager presentAlert: alertRequest withCompletionHandler: nil ];
520
+
518
521
return ;
519
522
}
520
523
@@ -719,23 +722,23 @@ - (void)repeatWeatherInformation {
719
722
720
723
- (NSArray <SDLMenuCell *> *)weatherMenuCells {
721
724
__weak typeof (self) weakSelf = self;
722
- SDLMenuCell *showWeatherConditions = [[SDLMenuCell alloc ] initWithTitle: self .localization[@" cmd.current-conditions" ] icon: [[SDLArtwork alloc ] initWithImage: [[UIImage imageNamed: @" clear-day" ] imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate] persistent: YES asImageFormat: SDLArtworkImageFormatPNG] 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
+ 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) {
723
726
[weakSelf sendWeatherConditions: [WeatherDataManager sharedManager ].weatherConditions withSpeak: YES ];
724
727
}];
725
728
726
- SDLMenuCell *showDailyForecast = [[SDLMenuCell alloc ] initWithTitle: self .localization[@" cmd.daily-forecast" ] icon: [[SDLArtwork alloc ] initWithImage: [[UIImage imageNamed: @" menu-day" ] imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate] persistent: YES asImageFormat: SDLArtworkImageFormatPNG] voiceCommands: @[self .localization[@" vr.daily" ], self .localization[@" vr.daily-forecast" ], self .localization[@" vr.show-daily-forecast" ]] handler: ^(SDLTriggerSource _Nonnull triggerSource) {
729
+ 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) {
727
730
[weakSelf sendForecastList: [WeatherDataManager sharedManager ].dailyForecast infoType: MWInfoTypeDailyForecast withSpeak: YES ];
728
731
}];
729
732
730
- SDLMenuCell *showHourlyForecast = [[SDLMenuCell alloc ] initWithTitle: self .localization[@" cmd.hourly-forecast" ] icon: [[SDLArtwork alloc ] initWithImage: [[UIImage imageNamed: @" menu-time" ] imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate] persistent: YES asImageFormat: SDLArtworkImageFormatPNG] voiceCommands: @[self .localization[@" vr.hourly" ], self .localization[@" vr.hourly-forecast" ], self .localization[@" vr.show-hourly-forecast" ]] handler: ^(SDLTriggerSource _Nonnull triggerSource) {
733
+ SDLMenuCell *showHourlyForecast = [[SDLMenuCell alloc ] initWithTitle: self .localization[@" cmd.hourly-forecast" ] secondaryText: nil tertiaryText: nil icon: [[SDLArtwork alloc ] initWithImage: [[UIImage imageNamed: @" menu-time" ] imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate] persistent: YES asImageFormat: SDLArtworkImageFormatPNG] secondaryArtwork: nil voiceCommands: @[self .localization[@" vr.hourly" ], self .localization[@" vr.hourly-forecast" ], self .localization[@" vr.show-hourly-forecast" ]] handler: ^(SDLTriggerSource _Nonnull triggerSource) {
731
734
[weakSelf sendForecastList: [WeatherDataManager sharedManager ].hourlyForecast infoType: MWInfoTypeHourlyForecast withSpeak: YES ];
732
735
}];
733
736
734
- SDLMenuCell *showAlerts = [[SDLMenuCell alloc ] initWithTitle: self .localization[@" cmd.alerts" ] icon: [[SDLArtwork alloc ] initWithImage: [[UIImage imageNamed: @" menu-alert" ] imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate] persistent: YES asImageFormat: SDLArtworkImageFormatPNG] voiceCommands: @[self .localization[@" vr.alerts" ], self .localization[@" vr.show-alerts" ]] handler: ^(SDLTriggerSource _Nonnull triggerSource) {
737
+ SDLMenuCell *showAlerts = [[SDLMenuCell alloc ] initWithTitle: self .localization[@" cmd.alerts" ] secondaryText: nil tertiaryText: nil icon: [[SDLArtwork alloc ] initWithImage: [[UIImage imageNamed: @" menu-alert" ] imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate] persistent: YES asImageFormat: SDLArtworkImageFormatPNG] secondaryArtwork: nil voiceCommands: @[self .localization[@" vr.alerts" ], self .localization[@" vr.show-alerts" ]] handler: ^(SDLTriggerSource _Nonnull triggerSource) {
735
738
[weakSelf sendAlertList: [WeatherDataManager sharedManager ].alerts withSpeak: YES ];
736
739
}];
737
740
738
- SDLMenuCell *changeUnits = [[SDLMenuCell alloc ] initWithTitle: self .localization[@" cmd.change-units" ] icon: [[SDLArtwork alloc ] initWithImage: [[UIImage imageNamed: @" menu-units" ] imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate] persistent: YES asImageFormat: SDLArtworkImageFormatPNG] voiceCommands: @[self .localization[@" vr.units" ], self .localization[@" vr.change-units" ]] handler: ^(SDLTriggerSource _Nonnull triggerSource) {
741
+ SDLMenuCell *changeUnits = [[SDLMenuCell alloc ] initWithTitle: self .localization[@" cmd.change-units" ] secondaryText: nil tertiaryText: nil icon: [[SDLArtwork alloc ] initWithImage: [[UIImage imageNamed: @" menu-units" ] imageWithRenderingMode: UIImageRenderingModeAlwaysTemplate] persistent: YES asImageFormat: SDLArtworkImageFormatPNG] secondaryArtwork: nil voiceCommands: @[self .localization[@" vr.units" ], self .localization[@" vr.change-units" ]] handler: ^(SDLTriggerSource _Nonnull triggerSource) {
739
742
SDLInteractionMode mode = [triggerSource isEqualToEnum: SDLTriggerSourceMenu] ? SDLInteractionModeManualOnly : SDLInteractionModeBoth;
740
743
[weakSelf presentChangeUnitsInteraction: mode];
741
744
}];
@@ -748,18 +751,18 @@ - (void)repeatWeatherInformation {
748
751
NSMutableArray <SDLMenuCell *> *menu = [NSMutableArray array ];
749
752
750
753
if ([infoType isEqualToString: MWInfoTypeDailyForecast] || [infoType isEqualToString: MWInfoTypeHourlyForecast]) {
751
- [menu addObject: [[SDLMenuCell alloc ] initWithTitle: self .localization[@" cmd.show-list" ] icon: nil voiceCommands: @[self .localization[@" vr.list" ], self .localization[@" vr.show-list" ]] handler: ^(SDLTriggerSource _Nonnull triggerSource) {
754
+ [menu addObject: [[SDLMenuCell alloc ] initWithTitle: self .localization[@" cmd.show-list" ] secondaryText: nil tertiaryText: nil icon: nil secondaryArtwork :nil voiceCommands: @[self .localization[@" vr.list" ], self .localization[@" vr.show-list" ]] handler: ^(SDLTriggerSource _Nonnull triggerSource) {
752
755
SDLInteractionMode mode = [triggerSource isEqualToEnum: SDLTriggerSourceMenu] ? SDLInteractionModeManualOnly : SDLInteractionModeBoth;
753
756
[weakSelf presentForecastInteractionWithList: weakSelf.currentInfoTypeList ofType: infoType mode: mode];
754
757
}]];
755
758
} else if ([MWInfoTypeAlerts isEqualToString: infoType]) {
756
- [menu addObject: [[SDLMenuCell alloc ] initWithTitle: self .localization[@" cmd.show-message" ] icon: nil voiceCommands: @[self .localization[@" vr.message" ], self .localization[@" vr.show-message" ]] handler: ^(SDLTriggerSource _Nonnull triggerSource) {
759
+ [menu addObject: [[SDLMenuCell alloc ] initWithTitle: self .localization[@" cmd.show-message" ] secondaryText: nil tertiaryText: nil icon: nil secondaryArtwork :nil voiceCommands: @[self .localization[@" vr.message" ], self .localization[@" vr.show-message" ]] handler: ^(SDLTriggerSource _Nonnull triggerSource) {
757
760
SDLInteractionMode mode = [triggerSource isEqualToEnum: SDLTriggerSourceMenu] ? SDLInteractionModeManualOnly : SDLInteractionModeBoth;
758
761
[weakSelf presentForecastInteractionWithList: weakSelf.currentInfoTypeList ofType: infoType mode: mode];
759
762
}]];
760
763
}
761
764
762
- [menu addObject: [[SDLMenuCell alloc ] initWithTitle: self .localization[@" cmd.back" ] icon: nil voiceCommands: @[self .localization[@" vr.back" ]] handler: ^(SDLTriggerSource _Nonnull triggerSource) {
765
+ [menu addObject: [[SDLMenuCell alloc ] initWithTitle: self .localization[@" cmd.back" ] secondaryText: nil tertiaryText: nil icon: nil secondaryArtwork :nil voiceCommands: @[self .localization[@" vr.back" ]] handler: ^(SDLTriggerSource _Nonnull triggerSource) {
763
766
[weakSelf closeListInfoType: weakSelf.currentInfoType];
764
767
}]];
765
768
0 commit comments