Skip to content

Commit

Permalink
Merge pull request #1347 from smartdevicelink/feature/issue_1276_main…
Browse files Browse the repository at this point in the history
…_menu_tiles

Implement SDL-0231 Main Menu Tiles
  • Loading branch information
joeljfischer authored Oct 9, 2019
2 parents e968885 + bea6360 commit 2e82d5e
Show file tree
Hide file tree
Showing 32 changed files with 499 additions and 67 deletions.
6 changes: 3 additions & 3 deletions Example Apps/Example ObjC/MenuManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ + (SDLMenuCell *)sdlex_menuCellGetAllVehicleDataWithManager:(SDLManager *)manage
[submenuItems addObject:cell];
}

return [[SDLMenuCell alloc] initWithTitle:ACGetAllVehicleDataMenuName icon:[SDLArtwork artworkWithImage:[[UIImage imageNamed:CarBWIconImageName] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] asImageFormat:SDLArtworkImageFormatPNG] subCells:submenuItems];
return [[SDLMenuCell alloc] initWithTitle:ACGetAllVehicleDataMenuName icon:[SDLArtwork artworkWithImage:[[UIImage imageNamed:CarBWIconImageName] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] asImageFormat:SDLArtworkImageFormatPNG] submenuLayout:SDLMenuLayoutTiles subCells:submenuItems];
}

+ (NSArray<NSString *> *)sdlex_allVehicleDataTypes {
Expand Down Expand Up @@ -117,7 +117,7 @@ + (SDLMenuCell *)sdlex_menuCellChangeTemplateWithManager:(SDLManager *)manager {
}];
[submenuItems addObject:cell2];

return [[SDLMenuCell alloc] initWithTitle:ACSubmenuTemplateMenuName icon:nil subCells:[submenuItems copy]];
return [[SDLMenuCell alloc] initWithTitle:ACSubmenuTemplateMenuName icon:nil submenuLayout:SDLMenuLayoutList subCells:[submenuItems copy]];
}

+ (SDLMenuCell *)sdlex_menuCellWithSubmenuWithManager:(SDLManager *)manager {
Expand All @@ -129,7 +129,7 @@ + (SDLMenuCell *)sdlex_menuCellWithSubmenuWithManager:(SDLManager *)manager {
[submenuItems addObject:cell];
}

return [[SDLMenuCell alloc] initWithTitle:ACSubmenuMenuName icon:[SDLArtwork artworkWithImage:[[UIImage imageNamed:MenuBWIconImageName] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] asImageFormat:SDLArtworkImageFormatPNG] subCells:[submenuItems copy]];
return [[SDLMenuCell alloc] initWithTitle:ACSubmenuMenuName icon:[SDLArtwork artworkWithImage:[[UIImage imageNamed:MenuBWIconImageName] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] asImageFormat:SDLArtworkImageFormatPNG] submenuLayout:SDLMenuLayoutList subCells:[submenuItems copy]];
}

+ (SDLMenuCell *)sdlex_sliderMenuCellWithManager:(SDLManager *)manager {
Expand Down
6 changes: 3 additions & 3 deletions Example Apps/Example Swift/MenuManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private extension MenuManager {
})
}

return SDLMenuCell(title: ACGetAllVehicleDataMenuName, icon: SDLArtwork(image: UIImage(named: CarBWIconImageName)!.withRenderingMode(.alwaysTemplate), persistent: true, as: .PNG), subCells: submenuItems)
return SDLMenuCell(title: ACGetAllVehicleDataMenuName, submenuLayout: .tiles, icon: SDLArtwork(image: UIImage(named: CarBWIconImageName)!.withRenderingMode(.alwaysTemplate), persistent: true, as: .PNG), subCells: submenuItems)
}

/// A list of all possible vehicle data types
Expand Down Expand Up @@ -151,7 +151,7 @@ private extension MenuManager {
}
}))

return SDLMenuCell(title: ACSubmenuTemplateMenuName, icon: nil, subCells: submenuItems)
return SDLMenuCell(title: ACSubmenuTemplateMenuName, submenuLayout: .list, icon: nil, subCells: submenuItems)
}

/// Menu item that opens a submenu when selected
Expand All @@ -174,7 +174,7 @@ private extension MenuManager {
}))
}

return SDLMenuCell(title: ACSubmenuMenuName, icon: SDLArtwork(image: #imageLiteral(resourceName: "choice_set").withRenderingMode(.alwaysTemplate), persistent: true, as: .PNG), subCells: submenuItems)
return SDLMenuCell(title: ACSubmenuMenuName, submenuLayout: .list, icon: SDLArtwork(image: #imageLiteral(resourceName: "choice_set").withRenderingMode(.alwaysTemplate), persistent: true, as: .PNG), subCells: submenuItems)
}

private class func sliderMenuCell(with manager: SDLManager) -> SDLMenuCell {
Expand Down
2 changes: 2 additions & 0 deletions SmartDeviceLink-iOS.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ ss.public_header_files = [
'SmartDeviceLink/SDLMediaServiceManifest.h',
'SmartDeviceLink/SDLMediaType.h',
'SmartDeviceLink/SDLMenuCell.h',
'SmartDeviceLink/SDLMenuConfiguration.h',
'SmartDeviceLink/SDLMenuLayout.h',
'SmartDeviceLink/SDLMenuManagerConstants.h',
'SmartDeviceLink/SDLMenuParams.h',
'SmartDeviceLink/SDLMetadataTags.h',
Expand Down
36 changes: 34 additions & 2 deletions SmartDeviceLink-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,12 @@
5D75960D22972F830013207C /* TestSystemCapabilityObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D75960C22972F830013207C /* TestSystemCapabilityObserver.m */; };
5D75961122972FCA0013207C /* SDLSystemCapabilityObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D75960F22972FCA0013207C /* SDLSystemCapabilityObserver.h */; };
5D75961222972FCA0013207C /* SDLSystemCapabilityObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D75961022972FCA0013207C /* SDLSystemCapabilityObserver.m */; };
5D76750E22D8FB3700E8D71A /* SDLMenuLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D76750C22D8FB3700E8D71A /* SDLMenuLayout.h */; settings = {ATTRIBUTES = (Public, ); }; };
5D76750F22D8FB3700E8D71A /* SDLMenuLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D76750D22D8FB3700E8D71A /* SDLMenuLayout.m */; };
5D76751322D9088F00E8D71A /* SDLMenuConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D76751122D9088F00E8D71A /* SDLMenuConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; };
5D76751422D9088F00E8D71A /* SDLMenuConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D76751222D9088F00E8D71A /* SDLMenuConfiguration.m */; };
5D76751622D920FD00E8D71A /* SDLMenuConfigurationSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D76751522D920FD00E8D71A /* SDLMenuConfigurationSpec.m */; };
5D76751822D921CB00E8D71A /* SDLMenuLayoutSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D76751722D921CB00E8D71A /* SDLMenuLayoutSpec.m */; };
5D76E31C1D3805FF00647CFA /* SDLLockScreenManagerSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D76E31B1D3805FF00647CFA /* SDLLockScreenManagerSpec.m */; };
5D76E3211D39742300647CFA /* SDLViewControllerPresentable.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D76E3201D39742300647CFA /* SDLViewControllerPresentable.h */; };
5D76E3241D39767000647CFA /* SDLLockScreenPresenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D76E3221D39767000647CFA /* SDLLockScreenPresenter.h */; };
Expand Down Expand Up @@ -2761,6 +2767,12 @@
5D75960C22972F830013207C /* TestSystemCapabilityObserver.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = TestSystemCapabilityObserver.m; path = DevAPISpecs/TestSystemCapabilityObserver.m; sourceTree = "<group>"; };
5D75960F22972FCA0013207C /* SDLSystemCapabilityObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLSystemCapabilityObserver.h; sourceTree = "<group>"; };
5D75961022972FCA0013207C /* SDLSystemCapabilityObserver.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLSystemCapabilityObserver.m; sourceTree = "<group>"; };
5D76750C22D8FB3700E8D71A /* SDLMenuLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLMenuLayout.h; sourceTree = "<group>"; };
5D76750D22D8FB3700E8D71A /* SDLMenuLayout.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLMenuLayout.m; sourceTree = "<group>"; };
5D76751122D9088F00E8D71A /* SDLMenuConfiguration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SDLMenuConfiguration.h; sourceTree = "<group>"; };
5D76751222D9088F00E8D71A /* SDLMenuConfiguration.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLMenuConfiguration.m; sourceTree = "<group>"; };
5D76751522D920FD00E8D71A /* SDLMenuConfigurationSpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SDLMenuConfigurationSpec.m; path = DevAPISpecs/SDLMenuConfigurationSpec.m; sourceTree = "<group>"; };
5D76751722D921CB00E8D71A /* SDLMenuLayoutSpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDLMenuLayoutSpec.m; sourceTree = "<group>"; };
5D76E31B1D3805FF00647CFA /* SDLLockScreenManagerSpec.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SDLLockScreenManagerSpec.m; path = DevAPISpecs/SDLLockScreenManagerSpec.m; sourceTree = "<group>"; };
5D76E3201D39742300647CFA /* SDLViewControllerPresentable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLViewControllerPresentable.h; sourceTree = "<group>"; };
5D76E3221D39767000647CFA /* SDLLockScreenPresenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDLLockScreenPresenter.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3460,6 +3472,7 @@
1EB59CC9202DC8E300343A61 /* SDLMassageZoneSpec.m */,
162E82061A9BDE8A00906325 /* SDLMediaClockFormatSpec.m */,
88E6F1A9220E1720006156F9 /* SDLMediaTypeSpec.m */,
5D76751722D921CB00E8D71A /* SDLMenuLayoutSpec.m */,
8BBEA6081F324832003EEA26 /* SDLMetadataTypeSpec.m */,
1EB59CC7202DC86A00343A61 /* SDLModuleTypeSpec.m */,
88B58DC822204C9E0011B063 /* SDLNavigationActionSpec.m */,
Expand Down Expand Up @@ -4020,6 +4033,7 @@
5D339CE5207C0651000CC364 /* Menu */ = {
isa = PBXGroup;
children = (
5D76751022D907F500E8D71A /* Configuration */,
755F175E229F14F70041B9CB /* Dynamic Menu Update Utilities */,
5D339CEC207C08AB000CC364 /* Cells */,
5D339CF1207C0ACE000CC364 /* SDLMenuManager.h */,
Expand Down Expand Up @@ -4898,10 +4912,12 @@
5D61FB0A1A84238A00846EE7 /* SDLMediaClockFormat.m */,
88E6F1A5220E1588006156F9 /* SDLMediaType.h */,
88E6F1A6220E1588006156F9 /* SDLMediaType.m */,
1E5AD0461F1F773E0029B8AF /* SDLModuleType.h */,
1E5AD0471F1F773E0029B8AF /* SDLModuleType.m */,
5D76750C22D8FB3700E8D71A /* SDLMenuLayout.h */,
5D76750D22D8FB3700E8D71A /* SDLMenuLayout.m */,
8BBEA6041F324165003EEA26 /* SDLMetadataType.h */,
8BBEA6051F324165003EEA26 /* SDLMetadataType.m */,
1E5AD0461F1F773E0029B8AF /* SDLModuleType.h */,
1E5AD0471F1F773E0029B8AF /* SDLModuleType.m */,
88B58DC422204AF10011B063 /* SDLNavigationAction.h */,
88B58DC522204AF10011B063 /* SDLNavigationAction.m */,
88B58DBE222045320011B063 /* SDLNavigationJunction.h */,
Expand Down Expand Up @@ -5353,6 +5369,15 @@
name = Utilities;
sourceTree = "<group>";
};
5D76751022D907F500E8D71A /* Configuration */ = {
isa = PBXGroup;
children = (
5D76751122D9088F00E8D71A /* SDLMenuConfiguration.h */,
5D76751222D9088F00E8D71A /* SDLMenuConfiguration.m */,
);
name = Configuration;
sourceTree = "<group>";
};
5D76E31A1D3805E600647CFA /* LockScreen */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -6063,6 +6088,7 @@
5DAB5F5220989A8300A020C8 /* SDLVoiceCommandSpec.m */,
752ECDB8228C42E100D945F4 /* SDLMenuRunScoreSpec.m */,
752ECDBA228C532600D945F4 /* SDLMenuUpdateAlgorithmSpec.m */,
5D76751522D920FD00E8D71A /* SDLMenuConfigurationSpec.m */,
);
name = Menu;
sourceTree = "<group>";
Expand Down Expand Up @@ -6681,6 +6707,7 @@
5D61FC511A84238C00846EE7 /* SDLButtonCapabilities.h in Headers */,
5D61FDE91A84238C00846EE7 /* SDLUnsubscribeButtonResponse.h in Headers */,
5D61FCD51A84238C00846EE7 /* SDLImageType.h in Headers */,
5D76750E22D8FB3700E8D71A /* SDLMenuLayout.h in Headers */,
8803DCEF22C2B84B00FBB7CE /* SDLBackgroundTaskManager.h in Headers */,
5D61FC2F1A84238C00846EE7 /* SDLAddCommandResponse.h in Headers */,
5D0C2A0020D9479B008B56CD /* SDLStreamingVideoLifecycleManager.h in Headers */,
Expand All @@ -6697,6 +6724,7 @@
5D61FD7B1A84238C00846EE7 /* SDLScrollableMessage.h in Headers */,
DA9F7E931DCC04E400ACAE48 /* SDLUnsubscribeWayPoints.h in Headers */,
5D61FD3D1A84238C00846EE7 /* SDLPrimaryAudioSource.h in Headers */,
5D76751322D9088F00E8D71A /* SDLMenuConfiguration.h in Headers */,
DAC5725C1D10B81E0004288B /* SDLTouch.h in Headers */,
5D6F7A2E1BC5650B0070BF37 /* SDLLifecycleConfiguration.h in Headers */,
5D61FCCD1A84238C00846EE7 /* SDLImage.h in Headers */,
Expand Down Expand Up @@ -7515,6 +7543,7 @@
5D92935F20B33FF700FCC775 /* SDLChoiceSet.m in Sources */,
8855F9E4220CB04000A5C897 /* SDLOnAppServiceData.m in Sources */,
5D61FC321A84238C00846EE7 /* SDLAddSubMenu.m in Sources */,
5D76751422D9088F00E8D71A /* SDLMenuConfiguration.m in Sources */,
5D61FDF61A84238C00846EE7 /* SDLV1ProtocolHeader.m in Sources */,
EE798CA620561218008EDE8E /* SDLSecondaryTransportManager.m in Sources */,
88B58DC1222045320011B063 /* SDLNavigationJunction.m in Sources */,
Expand Down Expand Up @@ -7560,6 +7589,7 @@
5D61FD9E1A84238C00846EE7 /* SDLSliderResponse.m in Sources */,
1EAA47462035623B000FE74B /* SDLLightControlData.m in Sources */,
0055412F22D759BD003194D3 /* SDLSeatLocation.m in Sources */,
5D76750F22D8FB3700E8D71A /* SDLMenuLayout.m in Sources */,
5D61FC5C1A84238C00846EE7 /* SDLChangeRegistration.m in Sources */,
5D1665C91CF8CA3D00CC4CA1 /* SDLPermissionFilter.m in Sources */,
5D61FDBA1A84238C00846EE7 /* SDLSyncPDataResponse.m in Sources */,
Expand Down Expand Up @@ -7747,12 +7777,14 @@
162E82FD1A9BDE8B00906325 /* SDLSystemContextSpec.m in Sources */,
162E82E21A9BDE8B00906325 /* SDLIgnitionStableStatusSpec.m in Sources */,
162E82EE1A9BDE8B00906325 /* SDLMediaClockFormatSpec.m in Sources */,
5D76751822D921CB00E8D71A /* SDLMenuLayoutSpec.m in Sources */,
5DA026901AD44EE700019F86 /* SDLDialNumberResponseSpec.m in Sources */,
162E83901A9BDE8B00906325 /* SDLTireStatusSpec.m in Sources */,
000DD57622EF0971005AB7A7 /* SDLReleaseInteriorVehicleDataModuleResponseSpec.m in Sources */,
162E82E01A9BDE8B00906325 /* SDLHMILevelSpec.m in Sources */,
88F65133220C6DC300CAF321 /* SDLWeatherAlertSpec.m in Sources */,
5DC09EDA1F2F7FEC00F4AB1D /* SDLControlFramePayloadNakSpec.m in Sources */,
5D76751622D920FD00E8D71A /* SDLMenuConfigurationSpec.m in Sources */,
1EB59CCE202DC97900343A61 /* SDLMassageCushionSpec.m in Sources */,
88EF8EBA22D8F48300CB06C2 /* SDLCancelInteractionSpec.m in Sources */,
162E83041A9BDE8B00906325 /* SDLUpdateModeSpec.m in Sources */,
Expand Down
2 changes: 2 additions & 0 deletions SmartDeviceLink.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ sdefault.public_header_files = [
'SmartDeviceLink/SDLMediaServiceManifest.h',
'SmartDeviceLink/SDLMediaType.h',
'SmartDeviceLink/SDLMenuCell.h',
'SmartDeviceLink/SDLMenuConfiguration.h',
'SmartDeviceLink/SDLMenuLayout.h',
'SmartDeviceLink/SDLMenuManagerConstants.h',
'SmartDeviceLink/SDLMenuParams.h',
'SmartDeviceLink/SDLMetadataTags.h',
Expand Down
13 changes: 11 additions & 2 deletions SmartDeviceLink/SDLAddSubMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#import "SDLRPCRequest.h"

#import "SDLMenuLayout.h"

@class SDLImage;

/**
Expand All @@ -25,9 +27,11 @@ NS_ASSUME_NONNULL_BEGIN

- (instancetype)initWithId:(UInt32)menuId menuName:(NSString *)menuName;

- (instancetype)initWithId:(UInt32)menuId menuName:(NSString *)menuName position:(UInt8)position __deprecated_msg(("Use initWithId:menuName:menuIcon:position: instead"));
- (instancetype)initWithId:(UInt32)menuId menuName:(NSString *)menuName position:(UInt8)position __deprecated_msg("Use initWithId:menuName:menuLayout:menuIcon:position: instead");

- (instancetype)initWithId:(UInt32)menuId menuName:(NSString *)menuName menuIcon:(nullable SDLImage *)icon position:(UInt8)position __deprecated_msg("Use initWithId:menuName:menuLayout:menuIcon:position: instead");

- (instancetype)initWithId:(UInt32)menuId menuName:(NSString *)menuName menuIcon:(nullable SDLImage *)icon position:(UInt8)position;
- (instancetype)initWithId:(UInt32)menuId menuName:(NSString *)menuName menuLayout:(nullable SDLMenuLayout)menuLayout menuIcon:(nullable SDLImage *)icon position:(UInt8)position;

/**
* a Menu ID that identifies a sub menu
Expand Down Expand Up @@ -68,6 +72,11 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (strong, nonatomic, nullable) SDLImage *menuIcon;

/**
The sub-menu layout. See available menu layouts on SDLWindowCapability.menuLayoutsAvailable. Defaults to LIST.
*/
@property (strong, nonatomic, nullable) SDLMenuLayout menuLayout;

@end

NS_ASSUME_NONNULL_END
39 changes: 26 additions & 13 deletions SmartDeviceLink/SDLAddSubMenu.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,33 @@ - (instancetype)init {
}
#pragma clang diagnostic pop

- (instancetype)initWithId:(UInt32)menuId menuName:(NSString *)menuName menuIcon:(nullable SDLImage *)icon position:(UInt8)position {
self = [self initWithId:menuId menuName:menuName];
if (!self) { return nil; }
- (instancetype)initWithId:(UInt32)menuId menuName:(NSString *)menuName {
self = [self init];
if (!self) {
return nil;
}

self.position = @(position);
self.menuIcon = icon;
self.menuID = @(menuId);
self.menuName = menuName;

return self;
}

- (instancetype)initWithId:(UInt32)menuId menuName:(NSString *)menuName position:(UInt8)position {
return [self initWithId:menuId menuName:menuName menuIcon:nil position:position];
return [self initWithId:menuId menuName:menuName menuLayout:nil menuIcon:nil position:position];
}

- (instancetype)initWithId:(UInt32)menuId menuName:(NSString *)menuName {
self = [self init];
if (!self) {
return nil;
}
- (instancetype)initWithId:(UInt32)menuId menuName:(NSString *)menuName menuIcon:(nullable SDLImage *)icon position:(UInt8)position {
return [self initWithId:menuId menuName:menuName menuLayout:nil menuIcon:icon position:position];
}

self.menuID = @(menuId);
self.menuName = menuName;
- (instancetype)initWithId:(UInt32)menuId menuName:(NSString *)menuName menuLayout:(nullable SDLMenuLayout)menuLayout menuIcon:(nullable SDLImage *)icon position:(UInt8)position {
self = [self initWithId:menuId menuName:menuName];
if (!self) { return nil; }

self.position = @(position);
self.menuIcon = icon;
self.menuLayout = menuLayout;

return self;
}
Expand Down Expand Up @@ -80,6 +85,14 @@ - (nullable SDLImage *)menuIcon {
return [self.parameters sdl_objectForName:SDLRPCParameterNameMenuIcon ofClass:[SDLImage class] error:nil];
}

- (void)setMenuLayout:(nullable SDLMenuLayout)menuLayout {
[self.parameters sdl_setObject:menuLayout forName:SDLRPCParameterNameMenuLayout];
}

- (nullable SDLMenuLayout)menuLayout {
return [self.parameters sdl_enumForName:SDLRPCParameterNameMenuLayout error:nil];
}

@end

NS_ASSUME_NONNULL_END
20 changes: 19 additions & 1 deletion SmartDeviceLink/SDLMenuCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#import <Foundation/Foundation.h>

#import "SDLMenuLayout.h"
#import "SDLTriggerSource.h"

@class SDLArtwork;
Expand Down Expand Up @@ -43,6 +44,11 @@ typedef void(^SDLMenuCellSelectionHandler)(SDLTriggerSource triggerSource);
*/
@property (copy, nonatomic, readonly, nullable) NSArray<SDLMenuCell *> *subCells;

/**
The layout in which the `subCells` will be displayed.
*/
@property (strong, nonatomic, readonly, nullable) SDLMenuLayout submenuLayout;

/**
Create a menu cell that has no subcells.
Expand Down Expand Up @@ -71,7 +77,19 @@ typedef void(^SDLMenuCellSelectionHandler)(SDLTriggerSource triggerSource);
@param subCells The subcells that will appear when the cell is selected
@return The menu cell
*/
- (instancetype)initWithTitle:(NSString *)title icon:(nullable SDLArtwork *)icon subCells:(NSArray<SDLMenuCell *> *)subCells;
- (instancetype)initWithTitle:(NSString *)title icon:(nullable SDLArtwork *)icon subCells:(NSArray<SDLMenuCell *> *)subCells __deprecated_msg("Use initWithTitle:icon:layout:subcells: instead");

/**
Create a menu cell that has subcells and when selected will go into a deeper part of the menu
@param title The cell's primary text
@param icon The cell's image
@param layout The layout that the subCells will be layed out in if that submenu is entered
@param subCells The subcells that will appear when the cell is selected
@return The menu cell
*/
- (instancetype)initWithTitle:(NSString *)title icon:(nullable SDLArtwork *)icon submenuLayout:(nullable SDLMenuLayout)layout subCells:(NSArray<SDLMenuCell *> *)subCells;


@end

Expand Down
Loading

0 comments on commit 2e82d5e

Please sign in to comment.