Skip to content

Commit 9f90731

Browse files
authored
Merge pull request #370 from smartdevicelink/feature/main_menu_ui_updates
Main Menu UI Updates
2 parents 1e0e6be + 7b93ec1 commit 9f90731

5 files changed

Lines changed: 192 additions & 0 deletions

File tree

lib/js/src/rpc/enums/ImageFieldName.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,26 @@ class ImageFieldName extends Enum {
196196
return ImageFieldName._MAP.subtleAlertIcon;
197197
}
198198

199+
/**
200+
* Get the enum value for menuCommandSecondaryImage.
201+
* @since SmartDeviceLink 7.1.0
202+
* The secondary image field for AddCommand
203+
* @returns {String} - The enum value.
204+
*/
205+
static get menuCommandSecondaryImage () {
206+
return ImageFieldName._MAP.menuCommandSecondaryImage;
207+
}
208+
209+
/**
210+
* Get the enum value for menuSubMenuSecondaryImage.
211+
* @since SmartDeviceLink 7.1.0
212+
* The secondary image field for AddSubMenu
213+
* @returns {String} - The enum value.
214+
*/
215+
static get menuSubMenuSecondaryImage () {
216+
return ImageFieldName._MAP.menuSubMenuSecondaryImage;
217+
}
218+
199219
/**
200220
* Get the value for the given enum key
201221
* @param {*} key - A key to find in the map of the subclass
@@ -240,6 +260,8 @@ ImageFieldName._MAP = Object.freeze({
240260
'alertIcon': 'alertIcon',
241261
'subMenuIcon': 'subMenuIcon',
242262
'subtleAlertIcon': 'subtleAlertIcon',
263+
'menuCommandSecondaryImage': 'menuCommandSecondaryImage',
264+
'menuSubMenuSecondaryImage': 'menuSubMenuSecondaryImage',
243265
});
244266

245267
export { ImageFieldName };

lib/js/src/rpc/enums/TextFieldName.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,46 @@ class TextFieldName extends Enum {
377377
return TextFieldName._MAP.subtleAlertSoftButtonText;
378378
}
379379

380+
/**
381+
* Get the enum value for menuCommandSecondaryText.
382+
* @since SmartDeviceLink 7.1.0
383+
* Secondary text for AddCommand
384+
* @returns {String} - The enum value.
385+
*/
386+
static get menuCommandSecondaryText () {
387+
return TextFieldName._MAP.menuCommandSecondaryText;
388+
}
389+
390+
/**
391+
* Get the enum value for menuCommandTertiaryText.
392+
* @since SmartDeviceLink 7.1.0
393+
* Tertiary text for AddCommand
394+
* @returns {String} - The enum value.
395+
*/
396+
static get menuCommandTertiaryText () {
397+
return TextFieldName._MAP.menuCommandTertiaryText;
398+
}
399+
400+
/**
401+
* Get the enum value for menuSubMenuSecondaryText.
402+
* @since SmartDeviceLink 7.1.0
403+
* Secondary text for AddSubMenu
404+
* @returns {String} - The enum value.
405+
*/
406+
static get menuSubMenuSecondaryText () {
407+
return TextFieldName._MAP.menuSubMenuSecondaryText;
408+
}
409+
410+
/**
411+
* Get the enum value for menuSubMenuTertiaryText.
412+
* @since SmartDeviceLink 7.1.0
413+
* Tertiary text for AddSubMenu
414+
* @returns {String} - The enum value.
415+
*/
416+
static get menuSubMenuTertiaryText () {
417+
return TextFieldName._MAP.menuSubMenuTertiaryText;
418+
}
419+
380420
/**
381421
* Get the value for the given enum key
382422
* @param {*} key - A key to find in the map of the subclass
@@ -439,6 +479,10 @@ TextFieldName._MAP = Object.freeze({
439479
'subtleAlertText1': 'subtleAlertText1',
440480
'subtleAlertText2': 'subtleAlertText2',
441481
'subtleAlertSoftButtonText': 'subtleAlertSoftButtonText',
482+
'menuCommandSecondaryText': 'menuCommandSecondaryText',
483+
'menuCommandTertiaryText': 'menuCommandTertiaryText',
484+
'menuSubMenuSecondaryText': 'menuSubMenuSecondaryText',
485+
'menuSubMenuTertiaryText': 'menuSubMenuTertiaryText',
442486
});
443487

444488
export { TextFieldName };

lib/js/src/rpc/messages/AddCommand.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,32 @@ class AddCommand extends RpcRequest {
127127
getCmdIcon () {
128128
return this.getObject(Image, AddCommand.KEY_CMD_ICON);
129129
}
130+
131+
/**
132+
* Set the SecondaryImage
133+
* @since SmartDeviceLink 7.1.0
134+
* @param {Image} image - Optional secondary image struct for menu cell - The desired SecondaryImage.
135+
* @returns {AddCommand} - The class instance for method chaining.
136+
*/
137+
setSecondaryImage (image) {
138+
this._validateType(Image, image);
139+
this.setParameter(AddCommand.KEY_SECONDARY_IMAGE, image);
140+
return this;
141+
}
142+
143+
/**
144+
* Get the SecondaryImage
145+
* @returns {Image} - the KEY_SECONDARY_IMAGE value
146+
*/
147+
getSecondaryImage () {
148+
return this.getObject(Image, AddCommand.KEY_SECONDARY_IMAGE);
149+
}
130150
}
131151

132152
AddCommand.KEY_CMD_ID = 'cmdID';
133153
AddCommand.KEY_MENU_PARAMS = 'menuParams';
134154
AddCommand.KEY_VR_COMMANDS = 'vrCommands';
135155
AddCommand.KEY_CMD_ICON = 'cmdIcon';
156+
AddCommand.KEY_SECONDARY_IMAGE = 'secondaryImage';
136157

137158
export { AddCommand };

lib/js/src/rpc/messages/AddSubMenu.js

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,66 @@ class AddSubMenu extends RpcRequest {
167167
getParentID () {
168168
return this.getParameter(AddSubMenu.KEY_PARENT_ID);
169169
}
170+
171+
/**
172+
* Set the SecondaryText
173+
* @since SmartDeviceLink 7.1.0
174+
* @param {String} text - Optional secondary text to display - The desired SecondaryText.
175+
* {'string_min_length': 1, 'string_max_length': 500}
176+
* @returns {AddSubMenu} - The class instance for method chaining.
177+
*/
178+
setSecondaryText (text) {
179+
this.setParameter(AddSubMenu.KEY_SECONDARY_TEXT, text);
180+
return this;
181+
}
182+
183+
/**
184+
* Get the SecondaryText
185+
* @returns {String} - the KEY_SECONDARY_TEXT value
186+
*/
187+
getSecondaryText () {
188+
return this.getParameter(AddSubMenu.KEY_SECONDARY_TEXT);
189+
}
190+
191+
/**
192+
* Set the TertiaryText
193+
* @since SmartDeviceLink 7.1.0
194+
* @param {String} text - Optional tertiary text to display - The desired TertiaryText.
195+
* {'string_min_length': 1, 'string_max_length': 500}
196+
* @returns {AddSubMenu} - The class instance for method chaining.
197+
*/
198+
setTertiaryText (text) {
199+
this.setParameter(AddSubMenu.KEY_TERTIARY_TEXT, text);
200+
return this;
201+
}
202+
203+
/**
204+
* Get the TertiaryText
205+
* @returns {String} - the KEY_TERTIARY_TEXT value
206+
*/
207+
getTertiaryText () {
208+
return this.getParameter(AddSubMenu.KEY_TERTIARY_TEXT);
209+
}
210+
211+
/**
212+
* Set the SecondaryImage
213+
* @since SmartDeviceLink 7.1.0
214+
* @param {Image} image - Optional secondary image struct for sub-menu cell - The desired SecondaryImage.
215+
* @returns {AddSubMenu} - The class instance for method chaining.
216+
*/
217+
setSecondaryImage (image) {
218+
this._validateType(Image, image);
219+
this.setParameter(AddSubMenu.KEY_SECONDARY_IMAGE, image);
220+
return this;
221+
}
222+
223+
/**
224+
* Get the SecondaryImage
225+
* @returns {Image} - the KEY_SECONDARY_IMAGE value
226+
*/
227+
getSecondaryImage () {
228+
return this.getObject(Image, AddSubMenu.KEY_SECONDARY_IMAGE);
229+
}
170230
}
171231

172232
AddSubMenu.KEY_MENU_ID = 'menuID';
@@ -175,5 +235,8 @@ AddSubMenu.KEY_MENU_NAME = 'menuName';
175235
AddSubMenu.KEY_MENU_ICON = 'menuIcon';
176236
AddSubMenu.KEY_MENU_LAYOUT = 'menuLayout';
177237
AddSubMenu.KEY_PARENT_ID = 'parentID';
238+
AddSubMenu.KEY_SECONDARY_TEXT = 'secondaryText';
239+
AddSubMenu.KEY_TERTIARY_TEXT = 'tertiaryText';
240+
AddSubMenu.KEY_SECONDARY_IMAGE = 'secondaryImage';
178241

179242
export { AddSubMenu };

lib/js/src/rpc/structs/MenuParams.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,52 @@ class MenuParams extends RpcStruct {
100100
getMenuName () {
101101
return this.getParameter(MenuParams.KEY_MENU_NAME);
102102
}
103+
104+
/**
105+
* Set the SecondaryText
106+
* @since SmartDeviceLink 7.1.0
107+
* @param {String} text - Optional secondary text to display - The desired SecondaryText.
108+
* {'string_min_length': 1, 'string_max_length': 500}
109+
* @returns {MenuParams} - The class instance for method chaining.
110+
*/
111+
setSecondaryText (text) {
112+
this.setParameter(MenuParams.KEY_SECONDARY_TEXT, text);
113+
return this;
114+
}
115+
116+
/**
117+
* Get the SecondaryText
118+
* @returns {String} - the KEY_SECONDARY_TEXT value
119+
*/
120+
getSecondaryText () {
121+
return this.getParameter(MenuParams.KEY_SECONDARY_TEXT);
122+
}
123+
124+
/**
125+
* Set the TertiaryText
126+
* @since SmartDeviceLink 7.1.0
127+
* @param {String} text - Optional tertiary text to display - The desired TertiaryText.
128+
* {'string_min_length': 1, 'string_max_length': 500}
129+
* @returns {MenuParams} - The class instance for method chaining.
130+
*/
131+
setTertiaryText (text) {
132+
this.setParameter(MenuParams.KEY_TERTIARY_TEXT, text);
133+
return this;
134+
}
135+
136+
/**
137+
* Get the TertiaryText
138+
* @returns {String} - the KEY_TERTIARY_TEXT value
139+
*/
140+
getTertiaryText () {
141+
return this.getParameter(MenuParams.KEY_TERTIARY_TEXT);
142+
}
103143
}
104144

105145
MenuParams.KEY_PARENT_ID = 'parentID';
106146
MenuParams.KEY_POSITION = 'position';
107147
MenuParams.KEY_MENU_NAME = 'menuName';
148+
MenuParams.KEY_SECONDARY_TEXT = 'secondaryText';
149+
MenuParams.KEY_TERTIARY_TEXT = 'tertiaryText';
108150

109151
export { MenuParams };

0 commit comments

Comments
 (0)