Skip to content

Commit 4089471

Browse files
authored
Merge pull request #12 from SmartDeviceLink-Examples/feature/sdl-7.1
SDL 7.1 update
2 parents 24ba005 + bfc4924 commit 4089471

File tree

4 files changed

+34
-26
lines changed

4 files changed

+34
-26
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
build/
77
DerivedData/
88

9+
# OS generated files #
10+
######################
11+
.DS_Store
12+
.DS_Store?
13+
914
## Various settings
1015
*.pbxuser
1116
!default.pbxuser

Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ platform :ios, '10.0'
22
use_frameworks!
33

44
target 'MobileWeather' do
5-
# pod 'SmartDeviceLink', :git => 'https://github.com/smartdevicelink/sdl_ios.git', :branch => 'develop'
6-
pod 'SmartDeviceLink', '~> 7.0'
5+
# pod 'SmartDeviceLink', :git => 'https://github.com/smartdevicelink/sdl_ios.git', :tag => '7.1.0'
6+
pod 'SmartDeviceLink', '~> 7.1'
77
end

Podfile.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
PODS:
22
- BiSON (1.2.2)
3-
- SmartDeviceLink (7.0.0):
4-
- BiSON (~> 1.2.2)
5-
- SmartDeviceLink/Default (= 7.0.0)
6-
- SmartDeviceLink/Default (7.0.0):
7-
- BiSON (~> 1.2.2)
3+
- SmartDeviceLink (7.1.0):
4+
- BiSON (~> 1.2)
5+
- SmartDeviceLink/Default (= 7.1.0)
6+
- SmartDeviceLink/Default (7.1.0):
7+
- BiSON (~> 1.2)
88

99
DEPENDENCIES:
10-
- SmartDeviceLink (~> 7.0)
10+
- SmartDeviceLink (~> 7.1)
1111

1212
SPEC REPOS:
1313
trunk:
@@ -16,8 +16,8 @@ SPEC REPOS:
1616

1717
SPEC CHECKSUMS:
1818
BiSON: efb26805ec99f4ad516b77e9a32ced05f1c0985d
19-
SmartDeviceLink: f073aae27d529a70637e76a651f0353d636cf0c5
19+
SmartDeviceLink: abdd3273e6da415cb9340954e82852433ae4cf9a
2020

21-
PODFILE CHECKSUM: ffa2cab4e67f3181335663dcba8c06324ca5068e
21+
PODFILE CHECKSUM: babeb44ba65bb67091ee3d2517c78025629298b3
2222

23-
COCOAPODS: 1.10.0
23+
COCOAPODS: 1.10.1

SmartDeviceLinkService.m

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ - (void)presentForecastInteractionWithList:(NSArray *)forecasts ofType:(MWInfoTy
282282
}
283283
}
284284

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];
286287
[choices addObject:cell];
287288
}
288289

@@ -318,8 +319,8 @@ - (void)sendWelcomeMessageWithSpeak:(BOOL)withSpeak {
318319

319320
- (void)sendWeatherConditions:(WeatherConditions *)conditions withSpeak:(BOOL)withSpeak {
320321
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];
323324
}
324325

325326
self.currentInfoType = MWInfoTypeWeatherConditions;
@@ -360,8 +361,8 @@ - (void)sendWeatherConditions:(WeatherConditions *)conditions withSpeak:(BOOL)wi
360361

361362
- (void)sendForecastList:(NSArray *)forecasts infoType:(MWInfoType)infoType withSpeak:(BOOL)withSpeak {
362363
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];
365366
}
366367

367368
if ([infoType isEqualToString:MWInfoTypeDailyForecast]) {
@@ -513,8 +514,10 @@ - (void)showForecastAtIndex:(NSUInteger)index fromList:(NSArray<Forecast *> *)fo
513514

514515
- (void)sendAlertList:(NSArray *)alerts withSpeak:(BOOL)withSpeak {
515516
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+
518521
return;
519522
}
520523

@@ -719,23 +722,23 @@ - (void)repeatWeatherInformation {
719722

720723
- (NSArray<SDLMenuCell *> *)weatherMenuCells {
721724
__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) {
723726
[weakSelf sendWeatherConditions:[WeatherDataManager sharedManager].weatherConditions withSpeak:YES];
724727
}];
725728

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) {
727730
[weakSelf sendForecastList:[WeatherDataManager sharedManager].dailyForecast infoType:MWInfoTypeDailyForecast withSpeak:YES];
728731
}];
729732

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) {
731734
[weakSelf sendForecastList:[WeatherDataManager sharedManager].hourlyForecast infoType:MWInfoTypeHourlyForecast withSpeak:YES];
732735
}];
733736

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) {
735738
[weakSelf sendAlertList:[WeatherDataManager sharedManager].alerts withSpeak:YES];
736739
}];
737740

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) {
739742
SDLInteractionMode mode = [triggerSource isEqualToEnum:SDLTriggerSourceMenu] ? SDLInteractionModeManualOnly : SDLInteractionModeBoth;
740743
[weakSelf presentChangeUnitsInteraction:mode];
741744
}];
@@ -748,18 +751,18 @@ - (void)repeatWeatherInformation {
748751
NSMutableArray<SDLMenuCell *> *menu = [NSMutableArray array];
749752

750753
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) {
752755
SDLInteractionMode mode = [triggerSource isEqualToEnum:SDLTriggerSourceMenu] ? SDLInteractionModeManualOnly : SDLInteractionModeBoth;
753756
[weakSelf presentForecastInteractionWithList:weakSelf.currentInfoTypeList ofType:infoType mode:mode];
754757
}]];
755758
} 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) {
757760
SDLInteractionMode mode = [triggerSource isEqualToEnum:SDLTriggerSourceMenu] ? SDLInteractionModeManualOnly : SDLInteractionModeBoth;
758761
[weakSelf presentForecastInteractionWithList:weakSelf.currentInfoTypeList ofType:infoType mode:mode];
759762
}]];
760763
}
761764

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) {
763766
[weakSelf closeListInfoType:weakSelf.currentInfoType];
764767
}]];
765768

0 commit comments

Comments
 (0)