diff options
author | Robert Henigan <robert.henigan@livio.io> | 2021-02-19 09:42:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-19 09:42:21 -0500 |
commit | aa485b4f5cf1f13e915ab71666c56226b9573ecd (patch) | |
tree | 322353a54a80b6fabd55eb3ab73a464ad0942e60 | |
parent | 3a84cea88ad75f1fa72152ac513f7198c758ab06 (diff) | |
parent | 7dc95343a5710f6ca4f9c2c5292847f19c1bc370 (diff) | |
download | sdl_android-aa485b4f5cf1f13e915ab71666c56226b9573ecd.tar.gz |
Merge pull request #1565 from smartdevicelink/feature/issue_1246
Add Changes from proposal for Main Menu UI updates
16 files changed, 516 insertions, 10 deletions
diff --git a/android/sdl_android/src/androidTest/assets/json/AddCommand.json b/android/sdl_android/src/androidTest/assets/json/AddCommand.json index c8dfe5267..88f3cdf4c 100644 --- a/android/sdl_android/src/androidTest/assets/json/AddCommand.json +++ b/android/sdl_android/src/androidTest/assets/json/AddCommand.json @@ -17,6 +17,10 @@ "parentID": 194, "position": 1, "menuName": "My Command" + }, + "secondaryImage": { + "value": "cmdImage1.png", + "imageType": "DYNAMIC" } } }, diff --git a/android/sdl_android/src/androidTest/assets/json/AddSubMenu.json b/android/sdl_android/src/androidTest/assets/json/AddSubMenu.json index 9b5cbd11b..2c9a7e326 100644 --- a/android/sdl_android/src/androidTest/assets/json/AddSubMenu.json +++ b/android/sdl_android/src/androidTest/assets/json/AddSubMenu.json @@ -9,6 +9,12 @@ "menuIcon": { "value": "cmdImage1.png", "imageType": "DYNAMIC" + }, + "secondaryText": "Secondary Text", + "tertiaryText": "Tertiary Text", + "secondaryImage": { + "value": "cmdImage1.png", + "imageType": "DYNAMIC" } } }, diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManagerTests.java index 3aba434c5..95977e857 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManagerTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManagerTests.java @@ -205,8 +205,8 @@ public class SystemCapabilityManagerTests { @Test public void testNullDisplayCapabilitiesEnablesAllTextAndImageFields() { List<DisplayCapability> displayCapabilityList = createDisplayCapabilityList(null, TestValues.GENERAL_BUTTONCAPABILITIES_LIST, TestValues.GENERAL_SOFTBUTTONCAPABILITIES_LIST); - assertEquals(displayCapabilityList.get(0).getWindowCapabilities().get(0).getTextFields().size(), 34); - assertEquals(displayCapabilityList.get(0).getWindowCapabilities().get(0).getImageFields().size(), 16); + assertEquals(displayCapabilityList.get(0).getWindowCapabilities().get(0).getTextFields().size(), 38); + assertEquals(displayCapabilityList.get(0).getWindowCapabilities().get(0).getImageFields().size(), 18); } @Test diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuCellTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuCellTests.java index dfd0477e5..f6d5d5adb 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuCellTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuCellTests.java @@ -32,6 +32,8 @@ package com.smartdevicelink.managers.screen.menu; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.test.ext.junit.runners.AndroidJUnit4; import com.smartdevicelink.managers.file.filetypes.SdlArtworkTests; @@ -70,6 +72,9 @@ public class MenuCellTests { menuCell.setVoiceCommands(TestValues.GENERAL_STRING_LIST); menuCell.setMenuSelectionListener(menuSelectionListener); menuCell.setSubMenuLayout(TestValues.GENERAL_MENU_LAYOUT); + menuCell.setSecondaryText(TestValues.GENERAL_STRING); + menuCell.setTertiaryText(TestValues.GENERAL_STRING); + menuCell.setSecondaryArtwork(TestValues.GENERAL_ARTWORK); // use getters and assert equality assertEquals(menuCell.getTitle(), TestValues.GENERAL_STRING); @@ -79,6 +84,9 @@ public class MenuCellTests { assertEquals(menuCell.getCellId(), TestValues.GENERAL_MENU_MAX_ID); assertEquals(menuCell.getParentCellId(), TestValues.GENERAL_MENU_MAX_ID); assertEquals(menuCell.getSubMenuLayout(), TestValues.GENERAL_MENU_LAYOUT); + assertEquals(menuCell.getSecondaryText(), TestValues.GENERAL_STRING); + assertEquals(menuCell.getTertiaryText(), TestValues.GENERAL_STRING); + assertEquals(menuCell.getSecondaryArtwork(), TestValues.GENERAL_ARTWORK); } @Test @@ -101,6 +109,28 @@ public class MenuCellTests { assertEquals(menuCell5.getIcon(), TestValues.GENERAL_ARTWORK); assertEquals(menuCell5.getSubMenuLayout(), TestValues.GENERAL_MENU_LAYOUT); assertEquals(menuCell5.getSubCells(), TestValues.GENERAL_MENUCELL_LIST); + + MenuCell menuCell6 = new MenuCell(TestValues.GENERAL_STRING, TestValues.GENERAL_STRING, TestValues.GENERAL_STRING, TestValues.GENERAL_ARTWORK, TestValues.GENERAL_ARTWORK, TestValues.GENERAL_STRING_LIST, menuSelectionListener); + assertEquals(menuCell6.getTitle(), TestValues.GENERAL_STRING); + assertEquals(menuCell6.getIcon(), TestValues.GENERAL_ARTWORK); + assertEquals(menuCell6.getSecondaryText(), TestValues.GENERAL_STRING); + assertEquals(menuCell6.getTertiaryText(), TestValues.GENERAL_STRING); + assertEquals(menuCell6.getSecondaryArtwork(), TestValues.GENERAL_ARTWORK); + assertEquals(menuCell6.getVoiceCommands(), TestValues.GENERAL_STRING_LIST); + assertEquals(menuCell6.getMenuSelectionListener(), menuSelectionListener); + + MenuCell menuCell7 = new MenuCell(TestValues.GENERAL_STRING, null, null, null, null, null, menuSelectionListener); + assertEquals(menuCell7.getTitle(), TestValues.GENERAL_STRING); + assertEquals(menuCell7.getMenuSelectionListener(), menuSelectionListener); + + MenuCell menuCell8 = new MenuCell(TestValues.GENERAL_STRING, TestValues.GENERAL_STRING, TestValues.GENERAL_STRING, TestValues.GENERAL_MENU_LAYOUT, TestValues.GENERAL_ARTWORK, TestValues.GENERAL_ARTWORK, TestValues.GENERAL_MENUCELL_LIST); + assertEquals(menuCell8.getTitle(), TestValues.GENERAL_STRING); + assertEquals(menuCell8.getIcon(), TestValues.GENERAL_ARTWORK); + assertEquals(menuCell8.getSecondaryText(), TestValues.GENERAL_STRING); + assertEquals(menuCell8.getTertiaryText(), TestValues.GENERAL_STRING); + assertEquals(menuCell8.getSecondaryArtwork(), TestValues.GENERAL_ARTWORK); + assertEquals(menuCell8.getSubMenuLayout(), TestValues.GENERAL_MENU_LAYOUT); + assertEquals(menuCell8.getSubCells(), TestValues.GENERAL_MENUCELL_LIST); } @Test @@ -109,7 +139,13 @@ public class MenuCellTests { //We should use assertTrue (or assertFalse) because we want to use the overridden equals() method MenuCell menuCell = new MenuCell(TestValues.GENERAL_STRING, TestValues.GENERAL_ARTWORK, TestValues.GENERAL_STRING_LIST, menuSelectionListener); + menuCell.setSecondaryText(TestValues.GENERAL_STRING); + menuCell.setTertiaryText(TestValues.GENERAL_STRING); + menuCell.setSecondaryArtwork(TestValues.GENERAL_ARTWORK); MenuCell menuCell2 = new MenuCell(TestValues.GENERAL_STRING, TestValues.GENERAL_ARTWORK, TestValues.GENERAL_STRING_LIST, menuSelectionListener); + menuCell2.setSecondaryText(TestValues.GENERAL_STRING); + menuCell2.setTertiaryText(TestValues.GENERAL_STRING); + menuCell2.setSecondaryArtwork(TestValues.GENERAL_ARTWORK); // these are the same object, should be equal. assertTrue(menuCell.equals(menuCell)); @@ -126,6 +162,9 @@ public class MenuCellTests { @Test public void testClone() { MenuCell original = new MenuCell(TestValues.GENERAL_STRING, TestValues.GENERAL_ARTWORK, TestValues.GENERAL_STRING_LIST, menuSelectionListener); + original.setSecondaryText(TestValues.GENERAL_STRING); + original.setTertiaryText(TestValues.GENERAL_STRING); + original.setSecondaryArtwork(TestValues.GENERAL_ARTWORK); MenuCell clone = original.clone(); assertNotNull(clone); @@ -134,8 +173,11 @@ public class MenuCellTests { assertEquals(original.getTitle(), clone.getTitle()); assertEquals(original.getCellId(), clone.getCellId()); assertEquals(original.getParentCellId(), clone.getParentCellId()); + assertEquals(original.getSecondaryText(), clone.getSecondaryText()); + assertEquals(original.getTertiaryText(), clone.getTertiaryText()); SdlArtworkTests.equalTest(original.getIcon(), clone.getIcon()); + SdlArtworkTests.equalTest(original.getSecondaryArtwork(), clone.getSecondaryArtwork()); //Test subcells List<MenuCell> subcells = new ArrayList<>(); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MenuParamsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MenuParamsTests.java index 998d8f4d4..edea4a706 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MenuParamsTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/MenuParamsTests.java @@ -26,6 +26,8 @@ public class MenuParamsTests extends TestCase { msg.setMenuName(TestValues.GENERAL_STRING); msg.setParentID(TestValues.GENERAL_INT); msg.setPosition(TestValues.GENERAL_INT); + msg.setSecondaryText(TestValues.GENERAL_STRING); + msg.setTertiaryText(TestValues.GENERAL_STRING); } /** @@ -36,11 +38,15 @@ public class MenuParamsTests extends TestCase { String menuName = msg.getMenuName(); int parentId = msg.getParentID(); int position = msg.getPosition(); + String secondaryText = msg.getSecondaryText(); + String tertiaryText = msg.getTertiaryText(); // Valid Tests assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, menuName); assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, parentId); assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, position); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, secondaryText); + assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, tertiaryText); // Invalid/Null Tests MenuParams msg = new MenuParams(); @@ -49,6 +55,8 @@ public class MenuParamsTests extends TestCase { assertNull(TestValues.NULL, msg.getMenuName()); assertNull(TestValues.NULL, msg.getParentID()); assertNull(TestValues.NULL, msg.getPosition()); + assertNull(TestValues.NULL, msg.getSecondaryText()); + assertNull(TestValues.NULL, msg.getTertiaryText()); } public void testJson() { @@ -58,6 +66,8 @@ public class MenuParamsTests extends TestCase { reference.put(MenuParams.KEY_MENU_NAME, TestValues.GENERAL_STRING); reference.put(MenuParams.KEY_PARENT_ID, TestValues.GENERAL_INT); reference.put(MenuParams.KEY_POSITION, TestValues.GENERAL_INT); + reference.put(MenuParams.KEY_SECONDARY_TEXT, TestValues.GENERAL_STRING); + reference.put(MenuParams.KEY_TERTIARY_TEXT, TestValues.GENERAL_STRING); JSONObject underTest = msg.serializeJSON(); assertEquals(TestValues.MATCH, reference.length(), underTest.length()); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ImageFieldNameTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ImageFieldNameTests.java index 7e4f28dde..4e2030eaf 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ImageFieldNameTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/ImageFieldNameTests.java @@ -44,6 +44,10 @@ public class ImageFieldNameTests extends TestCase { ImageFieldName enumLocationImage = ImageFieldName.valueForString(example); example = "secondaryGraphic"; ImageFieldName enumSecondaryGraphic = ImageFieldName.valueForString(example); + example = "menuCommandSecondaryImage"; + ImageFieldName menuCommandSecondaryImage = ImageFieldName.valueForString(example); + example = "menuSubMenuSecondaryImage"; + ImageFieldName menuSubMenuSecondaryImage = ImageFieldName.valueForString(example); assertNotNull("softButtonImage returned null", enumSoftButtonImage); assertNotNull("choiceImage returned null", enumChoiceImage); @@ -58,6 +62,8 @@ public class ImageFieldNameTests extends TestCase { assertNotNull("showConstantTBTNextTurnIcon returned null", enumShowConstantTbtNextTurnIcon); assertNotNull("location image returned null", enumLocationImage); assertNotNull("secondary graphic returned null", enumSecondaryGraphic); + assertNotNull("menuCommandSecondaryImage returned null", menuCommandSecondaryImage); + assertNotNull("menuSubMenuSecondaryImage returned null", menuSubMenuSecondaryImage); } /** @@ -109,6 +115,8 @@ public class ImageFieldNameTests extends TestCase { enumTestList.add(ImageFieldName.alertIcon); enumTestList.add(ImageFieldName.subtleAlertIcon); enumTestList.add(ImageFieldName.subMenuIcon); + enumTestList.add(ImageFieldName.menuCommandSecondaryImage); + enumTestList.add(ImageFieldName.menuSubMenuSecondaryImage); assertTrue("Enum value list does not match enum class list", diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextFieldNameTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextFieldNameTests.java index dad5ea3e2..9f7b9a8e6 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextFieldNameTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/TextFieldNameTests.java @@ -77,6 +77,14 @@ public class TextFieldNameTests extends TestCase { TextFieldName enumPhone = TextFieldName.valueForString(example); example = "templateTitle"; TextFieldName templateTitle = TextFieldName.valueForString(example); + example = "menuCommandSecondaryText"; + TextFieldName menuCommandSecondaryText = TextFieldName.valueForString(example); + example = "menuCommandTertiaryText"; + TextFieldName menuCommandTertiaryText = TextFieldName.valueForString(example); + example = "menuSubMenuSecondaryText"; + TextFieldName menuSubMenuSecondaryText = TextFieldName.valueForString(example); + example = "menuSubMenuTertiaryText"; + TextFieldName menuSubMenuTertiaryText = TextFieldName.valueForString(example); assertNotNull("mainField1 returned null", enumMainField1); assertNotNull("mainField2 returned null", enumMainField2); @@ -103,6 +111,10 @@ public class TextFieldNameTests extends TestCase { assertNotNull("tertiaryText returned null", enumTertiaryText); assertNotNull("menuTitle returned null", enumMenuTitle); assertNotNull("templateTitle returned null", templateTitle); + assertNotNull("menuCommandSecondaryText returned null", menuCommandSecondaryText); + assertNotNull("menuCommandTertiaryText returned null", menuCommandTertiaryText); + assertNotNull("menuSubMenuSecondaryText returned null", menuSubMenuSecondaryText); + assertNotNull("menuSubMenuTertiaryText returned null", menuSubMenuTertiaryText); assertNotNull(TestValues.NOT_NULL, enumLocName); @@ -178,6 +190,10 @@ public class TextFieldNameTests extends TestCase { enumTestList.add(TextFieldName.subtleAlertText1); enumTestList.add(TextFieldName.subtleAlertText2); enumTestList.add(TextFieldName.subtleAlertSoftButtonText); + enumTestList.add(TextFieldName.menuCommandSecondaryText); + enumTestList.add(TextFieldName.menuCommandTertiaryText); + enumTestList.add(TextFieldName.menuSubMenuSecondaryText); + enumTestList.add(TextFieldName.menuSubMenuTertiaryText); assertTrue("Enum value list does not match enum class list", enumValueList.containsAll(enumTestList) && enumTestList.containsAll(enumValueList)); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddCommandTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddCommandTests.java index ebcb09943..f76e5eadd 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddCommandTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddCommandTests.java @@ -40,6 +40,7 @@ public class AddCommandTests extends BaseRpcTests { msg.setMenuParams(TestValues.GENERAL_MENUPARAMS); msg.setVrCommands(TestValues.GENERAL_STRING_LIST); msg.setCmdID(TestValues.GENERAL_INT); + msg.setSecondaryImage(TestValues.GENERAL_IMAGE); return msg; } @@ -63,6 +64,7 @@ public class AddCommandTests extends BaseRpcTests { result.put(AddCommand.KEY_MENU_PARAMS, TestValues.JSON_MENUPARAMS); result.put(AddCommand.KEY_VR_COMMANDS, JsonUtils.createJsonArray(TestValues.GENERAL_STRING_LIST)); result.put(AddCommand.KEY_CMD_ID, TestValues.GENERAL_INT); + result.put(AddCommand.KEY_SECONDARY_IMAGE, TestValues.JSON_IMAGE); } catch (JSONException e) { fail(TestValues.JSON_FAIL); } @@ -80,11 +82,13 @@ public class AddCommandTests extends BaseRpcTests { Image testImage = ((AddCommand) msg).getCmdIcon(); MenuParams testMenuParams = ((AddCommand) msg).getMenuParams(); List<String> testVrCommands = ((AddCommand) msg).getVrCommands(); + Image testSecondaryImage = ((AddCommand) msg).getSecondaryImage(); // Valid Tests assertNotNull(TestValues.NOT_NULL, testMenuParams); assertNotNull(TestValues.NOT_NULL, testImage); assertNotNull(TestValues.NOT_NULL, testVrCommands); + assertNotNull(TestValues.NOT_NULL, testSecondaryImage); assertEquals(TestValues.MATCH, TestValues.GENERAL_INT, testCmdId); assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING_LIST.size(), testVrCommands.size()); @@ -92,6 +96,7 @@ public class AddCommandTests extends BaseRpcTests { assertTrue(TestValues.TRUE, Validator.validateMenuParams(TestValues.GENERAL_MENUPARAMS, testMenuParams)); assertTrue(TestValues.TRUE, Validator.validateImage(TestValues.GENERAL_IMAGE, testImage)); assertTrue(TestValues.TRUE, Validator.validateStringList(TestValues.GENERAL_STRING_LIST, testVrCommands)); + assertTrue(TestValues.TRUE, Validator.validateImage(TestValues.GENERAL_IMAGE, testSecondaryImage)); // Invalid/Null Tests AddCommand msg = new AddCommand(); @@ -102,6 +107,7 @@ public class AddCommandTests extends BaseRpcTests { assertNull(TestValues.NULL, msg.getCmdID()); assertNull(TestValues.NULL, msg.getMenuParams()); assertNull(TestValues.NULL, msg.getVrCommands()); + assertNull(TestValues.NULL, msg.getSecondaryImage()); } /** @@ -140,6 +146,10 @@ public class AddCommandTests extends BaseRpcTests { Image referenceCmdIcon = new Image(JsonRPCMarshaller.deserializeJSONObject(cmdIcon)); assertTrue(TestValues.TRUE, Validator.validateImage(referenceCmdIcon, cmd.getCmdIcon())); + JSONObject secondaryIcon = JsonUtils.readJsonObjectFromJsonObject(parameters, AddCommand.KEY_SECONDARY_IMAGE); + Image referenceSecondaryIcon = new Image(JsonRPCMarshaller.deserializeJSONObject(secondaryIcon)); + assertTrue(TestValues.TRUE, Validator.validateImage(referenceSecondaryIcon, cmd.getSecondaryImage())); + } catch (JSONException e) { e.printStackTrace(); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java index e135d3217..db70162ab 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java @@ -41,6 +41,9 @@ public class AddSubmenuTests extends BaseRpcTests { msg.setMenuIcon(TestValues.GENERAL_IMAGE); msg.setMenuLayout(TestValues.GENERAL_MENU_LAYOUT); msg.setParentID(TestValues.GENERAL_MENU_MAX_ID); + msg.setSecondaryText(TestValues.GENERAL_STRING); + msg.setTertiaryText(TestValues.GENERAL_STRING); + msg.setSecondaryImage(TestValues.GENERAL_IMAGE); return msg; } @@ -66,6 +69,9 @@ public class AddSubmenuTests extends BaseRpcTests { result.put(AddSubMenu.KEY_MENU_ICON, TestValues.JSON_IMAGE); result.put(AddSubMenu.KEY_MENU_LAYOUT, TestValues.GENERAL_MENU_LAYOUT); result.put(AddSubMenu.KEY_PARENT_ID, TestValues.GENERAL_MENU_MAX_ID); + result.put(AddSubMenu.KEY_SECONDARY_TEXT, TestValues.GENERAL_STRING); + result.put(AddSubMenu.KEY_TERTIARY_TEXT, TestValues.GENERAL_STRING); + result.put(AddSubMenu.KEY_SECONDARY_IMAGE, TestValues.JSON_IMAGE); } catch (JSONException e) { fail(TestValues.JSON_FAIL); } @@ -85,6 +91,9 @@ public class AddSubmenuTests extends BaseRpcTests { Image testMenuIcon = ((AddSubMenu) msg).getMenuIcon(); MenuLayout testMenuLayout = ((AddSubMenu) msg).getMenuLayout(); int testParentID = ((AddSubMenu) msg).getParentID(); + String testSecondaryText = ((AddSubMenu) msg).getSecondaryText(); + String testTertiaryText = ((AddSubMenu) msg).getTertiaryText(); + Image testSecondaryImage = ((AddSubMenu) msg).getSecondaryImage(); // Valid Tests assertEquals("Menu ID didn't match input menu ID.", TestValues.GENERAL_INT, testMenuId); @@ -93,6 +102,9 @@ public class AddSubmenuTests extends BaseRpcTests { assertTrue("Menu icon didn't match input icon.", Validator.validateImage(TestValues.GENERAL_IMAGE, testMenuIcon)); assertEquals("Menu layout didn't match input menu layout.", TestValues.GENERAL_MENU_LAYOUT, testMenuLayout); assertEquals("Parent ID didn't match input Parent ID.", TestValues.GENERAL_MENU_MAX_ID, testParentID); + assertEquals("Secondary Text didn't match input Secondary Text.", TestValues.GENERAL_STRING, testSecondaryText); + assertEquals("Tertiary Text didn't match input Tertiary Text.", TestValues.GENERAL_STRING, testTertiaryText); + assertTrue("Secondary Image didn't match input Secondary Image.", Validator.validateImage(TestValues.GENERAL_IMAGE, testSecondaryImage)); // Invalid/Null Tests @@ -106,6 +118,9 @@ public class AddSubmenuTests extends BaseRpcTests { assertNull(TestValues.NULL, msg.getMenuIcon()); assertNull(TestValues.NULL, msg.getMenuLayout()); assertNull(TestValues.NULL, msg.getParentID()); + assertNull(TestValues.NULL, msg.getSecondaryText()); + assertNull(TestValues.NULL, msg.getTertiaryText()); + assertNull(TestValues.NULL, msg.getSecondaryImage()); } /** @@ -134,10 +149,15 @@ public class AddSubmenuTests extends BaseRpcTests { assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, AddSubMenu.KEY_MENU_NAME), cmd.getMenuName()); assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(parameters, AddSubMenu.KEY_MENU_LAYOUT), cmd.getMenuLayout()); assertEquals(TestValues.MATCH, JsonUtils.readIntegerFromJsonObject(parameters, AddSubMenu.KEY_PARENT_ID), cmd.getParentID()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, AddSubMenu.KEY_SECONDARY_TEXT), cmd.getSecondaryText()); + assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, AddSubMenu.KEY_TERTIARY_TEXT), cmd.getTertiaryText()); JSONObject menuIcon = JsonUtils.readJsonObjectFromJsonObject(parameters, AddSubMenu.KEY_MENU_ICON); Image referenceMenuIcon = new Image(JsonRPCMarshaller.deserializeJSONObject(menuIcon)); assertTrue(TestValues.TRUE, Validator.validateImage(referenceMenuIcon, cmd.getMenuIcon())); + JSONObject secondaryIcon = JsonUtils.readJsonObjectFromJsonObject(parameters, AddSubMenu.KEY_SECONDARY_IMAGE); + Image referenceSecondaryIcon = new Image(JsonRPCMarshaller.deserializeJSONObject(secondaryIcon)); + assertTrue(TestValues.TRUE, Validator.validateImage(referenceSecondaryIcon, cmd.getSecondaryImage())); } catch (JSONException e) { fail(TestValues.JSON_FAIL); } diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseMenuManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseMenuManager.java index f44e0c2e3..28100a4c3 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseMenuManager.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseMenuManager.java @@ -753,7 +753,7 @@ abstract class BaseMenuManager extends BaseSubManager { private List<SdlArtwork> findAllArtworksToBeUploadedFromCells(List<MenuCell> cells) { // Make sure we can use images in the menus - if (!supportsImages()) { + if (!hasImageFieldOfName(ImageFieldName.cmdIcon)) { return new ArrayList<>(); } @@ -762,6 +762,17 @@ abstract class BaseMenuManager extends BaseSubManager { if (fileManager.get() != null && fileManager.get().fileNeedsUpload(cell.getIcon())) { artworks.add(cell.getIcon()); } + + if (cell.getSubCells() != null && cell.getSubCells().size() > 0 && hasImageFieldOfName(ImageFieldName.menuSubMenuSecondaryImage)) { + if (fileManager.get() != null && fileManager.get().fileNeedsUpload(cell.getSecondaryArtwork())) { + artworks.add(cell.getSecondaryArtwork()); + } + } else if ((cell.getSubCells() == null || cell.getSubCells().isEmpty()) && hasImageFieldOfName(ImageFieldName.menuCommandSecondaryImage)) { + if (fileManager.get() != null && fileManager.get().fileNeedsUpload(cell.getSecondaryArtwork())) { + artworks.add(cell.getSecondaryArtwork()); + } + } + if (cell.getSubCells() != null && cell.getSubCells().size() > 0) { artworks.addAll(findAllArtworksToBeUploadedFromCells(cell.getSubCells())); } @@ -773,8 +784,17 @@ abstract class BaseMenuManager extends BaseSubManager { private boolean shouldRPCsIncludeImages(List<MenuCell> cells) { for (MenuCell cell : cells) { SdlArtwork artwork = cell.getIcon(); + SdlArtwork secondaryArtwork = cell.getSecondaryArtwork(); if (artwork != null && !artwork.isStaticIcon() && fileManager.get() != null && !fileManager.get().hasUploadedFile(artwork)) { return false; + } else if (cell.getSubCells() != null && cell.getSubCells().size() > 0 && hasImageFieldOfName(ImageFieldName.menuSubMenuSecondaryImage)) { + if (secondaryArtwork != null && !secondaryArtwork.isStaticIcon() && fileManager.get() != null && !fileManager.get().hasUploadedFile(secondaryArtwork)) { + return false; + } + } else if ((cell.getSubCells() == null || cell.getSubCells().isEmpty()) && hasImageFieldOfName(ImageFieldName.menuCommandSecondaryImage)) { + if (secondaryArtwork != null && !secondaryArtwork.isStaticIcon() && fileManager.get() != null && !fileManager.get().hasUploadedFile(secondaryArtwork)) { + return false; + } } else if (cell.getSubCells() != null && cell.getSubCells().size() > 0) { return shouldRPCsIncludeImages(cell.getSubCells()); } @@ -782,9 +802,8 @@ abstract class BaseMenuManager extends BaseSubManager { return true; } - @SuppressWarnings("BooleanMethodIsAlwaysInverted") - private boolean supportsImages() { - return defaultMainWindowCapability == null || ManagerUtility.WindowCapabilityUtility.hasImageFieldOfName(defaultMainWindowCapability, ImageFieldName.cmdIcon); + private boolean hasImageFieldOfName(ImageFieldName imageFieldName) { + return defaultMainWindowCapability == null || ManagerUtility.WindowCapabilityUtility.hasImageFieldOfName(defaultMainWindowCapability, imageFieldName); } // IDs @@ -954,6 +973,8 @@ abstract class BaseMenuManager extends BaseSubManager { private AddCommand commandForMenuCell(MenuCell cell, boolean shouldHaveArtwork, int position) { MenuParams params = new MenuParams(cell.getTitle()); + params.setSecondaryText(cell.getSecondaryText()); + params.setTertiaryText(cell.getTertiaryText()); params.setParentID(cell.getParentCellId() != MAX_ID ? cell.getParentCellId() : null); params.setPosition(position); @@ -965,12 +986,15 @@ abstract class BaseMenuManager extends BaseSubManager { command.setVrCommands(null); } command.setCmdIcon((cell.getIcon() != null && shouldHaveArtwork) ? cell.getIcon().getImageRPC() : null); + command.setSecondaryImage((cell.getSecondaryArtwork() != null && shouldHaveArtwork && !(fileManager.get() != null && fileManager.get().fileNeedsUpload(cell.getSecondaryArtwork()))) ? cell.getSecondaryArtwork().getImageRPC() : null); return command; } private AddSubMenu subMenuCommandForMenuCell(MenuCell cell, boolean shouldHaveArtwork, int position) { AddSubMenu subMenu = new AddSubMenu(cell.getCellId(), cell.getTitle()); + subMenu.setSecondaryText(cell.getSecondaryText()); + subMenu.setTertiaryText(cell.getTertiaryText()); subMenu.setPosition(position); if (cell.getSubMenuLayout() != null) { subMenu.setMenuLayout(cell.getSubMenuLayout()); @@ -978,6 +1002,7 @@ abstract class BaseMenuManager extends BaseSubManager { subMenu.setMenuLayout(menuConfiguration.getSubMenuLayout()); } subMenu.setMenuIcon((shouldHaveArtwork && (cell.getIcon() != null && cell.getIcon().getImageRPC() != null)) ? cell.getIcon().getImageRPC() : null); + subMenu.setSecondaryImage((shouldHaveArtwork && !(fileManager.get() != null && fileManager.get().fileNeedsUpload(cell.getSecondaryArtwork())) && (cell.getSecondaryArtwork() != null && cell.getSecondaryArtwork().getImageRPC() != null)) ? cell.getSecondaryArtwork().getImageRPC() : null); return subMenu; } @@ -1137,7 +1162,7 @@ abstract class BaseMenuManager extends BaseSubManager { List<RPCRequest> mainMenuCommands; final List<RPCRequest> subMenuCommands; - if (!shouldRPCsIncludeImages(menu) || !supportsImages()) { + if (!shouldRPCsIncludeImages(menu) || !hasImageFieldOfName(ImageFieldName.cmdIcon)) { // Send artwork-less menu mainMenuCommands = mainMenuCommandsForCells(menu, false); subMenuCommands = subMenuCommandsForCells(menu, false); @@ -1242,7 +1267,7 @@ abstract class BaseMenuManager extends BaseSubManager { List<RPCRequest> mainMenuCommands; - if (!shouldRPCsIncludeImages(adds) || !supportsImages()) { + if (!shouldRPCsIncludeImages(adds) || !hasImageFieldOfName(ImageFieldName.cmdIcon)) { // Send artwork-less menu mainMenuCommands = createCommandsForDynamicSubCells(newMenu, adds, false); } else { diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuCell.java b/base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuCell.java index 83e265f8e..7694399a8 100644 --- a/base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuCell.java +++ b/base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuCell.java @@ -90,6 +90,16 @@ public class MenuCell implements Cloneable { */ private static final int MAX_ID = 2000000000; + /** + * secondaryText and tertiaryText - additional text to be displayed + */ + private String secondaryText, tertiaryText; + + /** + * secondaryArtwork - a secondary icon to be displayed + */ + private SdlArtwork secondaryArtwork; + // CONSTRUCTORS // SINGLE MENU ITEM CONSTRUCTORS @@ -102,6 +112,7 @@ public class MenuCell implements Cloneable { * @param voiceCommands Voice commands that will activate the menu cell * @param listener Calls the code that will be run when the menu cell is selected */ + @Deprecated public MenuCell(@NonNull String title, @Nullable SdlArtwork icon, @Nullable List<String> voiceCommands, @Nullable MenuSelectionListener listener) { setTitle(title); // title is the only required param setIcon(icon); @@ -111,6 +122,29 @@ public class MenuCell implements Cloneable { setParentCellId(MAX_ID); } + /** + * Creates a new MenuCell Object with multiple parameters and optional fields set + * + * @param title The cell's primary text + * @param secondaryText The cell's secondary text + * @param tertiaryText The cell's tertiary text + * @param icon The cell's image + * @param secondaryArtwork The cell's secondary image + * @param voiceCommands Voice commands that will activate the menu cell + * @param listener Calls the code that will be run when the menu cell is selected + */ + public MenuCell(@NonNull String title, @Nullable String secondaryText, @Nullable String tertiaryText, @Nullable SdlArtwork icon, @Nullable SdlArtwork secondaryArtwork, @Nullable List<String> voiceCommands, @Nullable MenuSelectionListener listener) { + setTitle(title); // title is the only required param + setSecondaryText(secondaryText); + setTertiaryText(tertiaryText); + setIcon(icon); + setSecondaryArtwork(secondaryArtwork); + setVoiceCommands(voiceCommands); + setMenuSelectionListener(listener); + setCellId(MAX_ID); + setParentCellId(MAX_ID); + } + // CONSTRUCTOR FOR CELL THAT WILL LINK TO SUB MENU /** @@ -123,6 +157,7 @@ public class MenuCell implements Cloneable { * @param icon The cell's image * @param subCells The sub-cells for the sub menu that will appear when the cell is selected */ + @Deprecated public MenuCell(@NonNull String title, @Nullable MenuLayout subMenuLayout, @Nullable SdlArtwork icon, @Nullable List<MenuCell> subCells) { setTitle(title); // title is the only required param setSubMenuLayout(subMenuLayout); @@ -132,6 +167,31 @@ public class MenuCell implements Cloneable { setParentCellId(MAX_ID); } + /** + * Creates a new MenuCell Object with multiple parameters and optional fields set + * <strong>NOTE: because this has sub-cells, there does not need to be a listener</strong> + * + * @param title The cell's primary text + * @param secondaryText The cell's secondary text + * @param tertiaryText The cell's tertiary text + * @param subMenuLayout The submenu's layout that the subCells will be shown in. If `null`, the + * default submenu layout in the screen manager's `MenuConfiguration` will be used. + * @param icon The cell's image + * @param secondaryArtwork The cell's secondary image + * @param subCells The sub-cells for the sub menu that will appear when the cell is selected + */ + public MenuCell(@NonNull String title, @Nullable String secondaryText, @Nullable String tertiaryText, @Nullable MenuLayout subMenuLayout, @Nullable SdlArtwork icon, @Nullable SdlArtwork secondaryArtwork, @Nullable List<MenuCell> subCells) { + setTitle(title); // title is the only required param + setSecondaryText(secondaryText); + setTertiaryText(tertiaryText); + setSubMenuLayout(subMenuLayout); + setIcon(icon); + setSecondaryArtwork(secondaryArtwork); + setSubCells(subCells); + setCellId(MAX_ID); + setParentCellId(MAX_ID); + } + // SETTERS / GETTERS // PUBLIC METHODS @@ -284,6 +344,61 @@ public class MenuCell implements Cloneable { return parentCellId; } + /** + * Sets the secondaryText + * + * @param secondaryText the cell's secondaryText + */ + public void setSecondaryText(String secondaryText) { + this.secondaryText = secondaryText; + } + + /** + * Get the cell's secondaryText + * + * @return the cell's secondaryText + */ + public String getSecondaryText() { + return secondaryText; + } + + /** + * Sets the tertiaryText + * + * @param tertiaryText the cell's tertiaryText + */ + public void setTertiaryText(String tertiaryText) { + this.tertiaryText = tertiaryText; + } + + + /** + * Get the cell's tertiaryText + * + * @return the cell's tertiaryText + */ + public String getTertiaryText(){ + return tertiaryText; + } + + /** + * Sets the secondaryArtwork + * + * @param secondaryArtwork the cell's secondaryArtwork + */ + public void setSecondaryArtwork(SdlArtwork secondaryArtwork) { + this.secondaryArtwork = secondaryArtwork; + } + + /** + * Get the cell's secondaryArtwork + * + * @return the cell's secondaryArtwork + */ + public SdlArtwork getSecondaryArtwork(){ + return secondaryArtwork; + } + // HELPER /** @@ -303,6 +418,9 @@ public class MenuCell implements Cloneable { result += ((getIcon() == null) ? 0 : Integer.rotateLeft(getIcon().hashCode(), 2)); result += ((getVoiceCommands() == null) ? 0 : Integer.rotateLeft(getVoiceCommands().hashCode(), 3)); result += ((getSubCells() == null) ? 0 : Integer.rotateLeft(1, 4)); + result += ((getSecondaryText() == null) ? 0 : Integer.rotateLeft(getSecondaryText().hashCode(), 1)); + result += ((getTertiaryText() == null) ? 0 : Integer.rotateLeft(getTertiaryText().hashCode(), 1)); + result += ((getSecondaryArtwork() == null) ? 0 : Integer.rotateLeft(getSecondaryArtwork().hashCode(), 2)); return result; } @@ -337,6 +455,9 @@ public class MenuCell implements Cloneable { if (this.icon != null) { clone.icon = this.icon.clone(); } + if (this.secondaryArtwork != null) { + clone.secondaryArtwork = this.secondaryArtwork.clone(); + } if (this.subCells != null) { ArrayList<MenuCell> cloneSubCells = new ArrayList<>(); for (MenuCell subCell : subCells) { diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommand.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommand.java index 1af9f8238..3458e361a 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommand.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommand.java @@ -107,6 +107,16 @@ import java.util.List; * <td></td>
* <td>SmartDeviceLink 1.0</td>
* </tr>
+ * <tr>
+ * <td>secondaryImage</td>
+ * <td>Image</td>
+ * <td>Optional secondary image struct for menu cell</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>
+ * @since SmartDeviceLink 7.1.0
+ * </td>
+ * </tr>
* </table>
* <p> <b>Response</b></p><p>Indicates that the corresponding request has failed or succeeded, if the response returns with a SUCCESS result code, this means a command was added to the Command Menu successfully.</p>
*
@@ -123,6 +133,7 @@ public class AddCommand extends RPCRequest { public static final String KEY_MENU_PARAMS = "menuParams";
public static final String KEY_CMD_ID = "cmdID";
public static final String KEY_VR_COMMANDS = "vrCommands";
+ public static final String KEY_SECONDARY_IMAGE = "secondaryImage";
/**
* Constructs a new AddCommand object
@@ -263,4 +274,25 @@ public class AddCommand extends RPCRequest { setParameters(KEY_CMD_ICON, cmdIcon);
return this;
}
+
+ /**
+ * Sets the secondaryImage.
+ *
+ * @param secondaryImage Optional secondary image struct for menu cell
+ * @since SmartDeviceLink 7.1.0
+ */
+ public AddCommand setSecondaryImage(Image secondaryImage) {
+ setParameters(KEY_SECONDARY_IMAGE, secondaryImage);
+ return this;
+ }
+
+ /**
+ * Gets the secondaryImage.
+ *
+ * @return Image Optional secondary image struct for menu cell
+ * @since SmartDeviceLink 7.1.0
+ */
+ public Image getSecondaryImage() {
+ return (Image) getObject(Image.class, KEY_SECONDARY_IMAGE);
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java index 38eed2ed1..93c5f0719 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java @@ -106,6 +106,36 @@ import java.util.Hashtable; * <td>Min Value: 0 <p>Max Value: 2000000000</p> </td>
* <td>SmartDeviceLink 7.0.0</td>
* </tr>
+ * <tr>
+ * <td>secondaryText</td>
+ * <td>String</td>
+ * <td>Optional secondary text to display</td>
+ * <td>N</td>
+ * <td>{"string_min_length": 1, "string_max_length": 500}</td>
+ * <td>
+ * @since SmartDeviceLink 7.1.0
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>tertiaryText</td>
+ * <td>String</td>
+ * <td>Optional tertiary text to display</td>
+ * <td>N</td>
+ * <td>{"string_min_length": 1, "string_max_length": 500}</td>
+ * <td>
+ * @since SmartDeviceLink 7.1.0
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>secondaryImage</td>
+ * <td>Image</td>
+ * <td>Optional secondary image struct for sub-menu cell</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>
+ * @since SmartDeviceLink 7.1.0
+ * </td>
+ * </tr>
* </table>
* <b>Response</b>
* <p>Indicates that the corresponding request either failed or succeeded. If the response returns with a SUCCESS result code, this means the SubMenu was added to the Command Menu successfully</p>
@@ -126,6 +156,10 @@ public class AddSubMenu extends RPCRequest { public static final String KEY_MENU_ICON = "menuIcon";
public static final String KEY_MENU_LAYOUT = "menuLayout";
public static final String KEY_PARENT_ID = "parentID";
+ public static final String KEY_SECONDARY_TEXT = "secondaryText";
+ public static final String KEY_TERTIARY_TEXT = "tertiaryText";
+ public static final String KEY_SECONDARY_IMAGE = "secondaryImage";
+
/**
* Constructs a new AddSubMenu object
@@ -293,4 +327,71 @@ public class AddSubMenu extends RPCRequest { public Integer getParentID() {
return getInteger(KEY_PARENT_ID);
}
+
+ /**
+ * Sets the secondaryText.
+ *
+ * @param secondaryText Optional secondary text to display
+ * {"string_min_length": 1, "string_max_length": 500}
+ * @since SmartDeviceLink 7.1.0
+ */
+ public AddSubMenu setSecondaryText(String secondaryText) {
+ setParameters(KEY_SECONDARY_TEXT, secondaryText);
+ return this;
+ }
+
+ /**
+ * Gets the secondaryText.
+ *
+ * @return String Optional secondary text to display
+ * {"string_min_length": 1, "string_max_length": 500}
+ * @since SmartDeviceLink 7.1.0
+ */
+ public String getSecondaryText() {
+ return getString(KEY_SECONDARY_TEXT);
+ }
+
+ /**
+ * Sets the tertiaryText.
+ *
+ * @param tertiaryText Optional tertiary text to display
+ * {"string_min_length": 1, "string_max_length": 500}
+ * @since SmartDeviceLink 7.1.0
+ */
+ public AddSubMenu setTertiaryText(String tertiaryText) {
+ setParameters(KEY_TERTIARY_TEXT, tertiaryText);
+ return this;
+ }
+
+ /**
+ * Gets the tertiaryText.
+ *
+ * @return String Optional tertiary text to display
+ * {"string_min_length": 1, "string_max_length": 500}
+ * @since SmartDeviceLink 7.1.0
+ */
+ public String getTertiaryText() {
+ return getString(KEY_TERTIARY_TEXT);
+ }
+
+ /**
+ * Sets the secondaryImage.
+ *
+ * @param secondaryImage Optional secondary image struct for sub-menu cell
+ * @since SmartDeviceLink 7.1.0
+ */
+ public AddSubMenu setSecondaryImage(Image secondaryImage) {
+ setParameters(KEY_SECONDARY_IMAGE, secondaryImage);
+ return this;
+ }
+
+ /**
+ * Gets the secondaryImage.
+ *
+ * @return Image Optional secondary image struct for sub-menu cell
+ * @since SmartDeviceLink 7.1.0
+ */
+ public Image getSecondaryImage() {
+ return (Image) getObject(Image.class, KEY_SECONDARY_IMAGE);
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java index 9c6635427..4801930f7 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java @@ -84,6 +84,26 @@ import java.util.Hashtable; * </td>
* <td>SmartDeviceLink 1.0</td>
* </tr>
+ * <tr>
+ * <td>secondaryText</td>
+ * <td>String</td>
+ * <td>Optional secondary text to display</td>
+ * <td>N</td>
+ * <td>{"string_min_length": 1, "string_max_length": 500}</td>
+ * <td>
+ * @since SmartDeviceLink 7.1.0
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>tertiaryText</td>
+ * <td>String</td>
+ * <td>Optional tertiary text to display</td>
+ * <td>N</td>
+ * <td>{"string_min_length": 1, "string_max_length": 500}</td>
+ * <td>
+ * @since SmartDeviceLink 7.1.0
+ * </td>
+ * </tr>
* </table>
*
* @see AddCommand
@@ -94,6 +114,14 @@ public class MenuParams extends RPCStruct { public static final String KEY_PARENT_ID = "parentID";
public static final String KEY_POSITION = "position";
public static final String KEY_MENU_NAME = "menuName";
+ /**
+ * @since SmartDeviceLink 7.1.0
+ */
+ public static final String KEY_SECONDARY_TEXT = "secondaryText";
+ /**
+ * @since SmartDeviceLink 7.1.0
+ */
+ public static final String KEY_TERTIARY_TEXT = "tertiaryText";
/**
* Constructs a newly allocated MenuParams object
@@ -202,4 +230,51 @@ public class MenuParams extends RPCStruct { setValue(KEY_MENU_NAME, menuName);
return this;
}
+
+
+ /**
+ * Sets the secondaryText.
+ *
+ * @param secondaryText Optional secondary text to display
+ * {"string_min_length": 1, "string_max_length": 500}
+ * @since SmartDeviceLink 7.1.0
+ */
+ public MenuParams setSecondaryText(String secondaryText) {
+ setValue(KEY_SECONDARY_TEXT, secondaryText);
+ return this;
+ }
+
+ /**
+ * Gets the secondaryText.
+ *
+ * @return String Optional secondary text to display
+ * {"string_min_length": 1, "string_max_length": 500}
+ * @since SmartDeviceLink 7.1.0
+ */
+ public String getSecondaryText() {
+ return getString(KEY_SECONDARY_TEXT);
+ }
+
+ /**
+ * Sets the tertiaryText.
+ *
+ * @param tertiaryText Optional tertiary text to display
+ * {"string_min_length": 1, "string_max_length": 500}
+ * @since SmartDeviceLink 7.1.0
+ */
+ public MenuParams setTertiaryText(String tertiaryText) {
+ setValue(KEY_TERTIARY_TEXT, tertiaryText);
+ return this;
+ }
+
+ /**
+ * Gets the tertiaryText.
+ *
+ * @return String Optional tertiary text to display
+ * {"string_min_length": 1, "string_max_length": 500}
+ * @since SmartDeviceLink 7.1.0
+ */
+ public String getTertiaryText() {
+ return getString(KEY_TERTIARY_TEXT);
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageFieldName.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageFieldName.java index d6a0d7fa3..4421e2a97 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageFieldName.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageFieldName.java @@ -121,7 +121,19 @@ public enum ImageFieldName { *
* @since SmartDeviceLink 7.0.0
*/
- subMenuIcon;
+ subMenuIcon,
+ /**
+ * The secondary image field for AddCommand
+ *
+ * @since SmartDeviceLink 7.1.0
+ */
+ menuCommandSecondaryImage,
+ /**
+ * The secondary image field for AddSubMenu
+ *
+ * @since SmartDeviceLink 7.1.0
+ */
+ menuSubMenuSecondaryImage;
/**
* Convert String to ImageFieldName
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextFieldName.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextFieldName.java index 6b07a2f9b..5658e3e17 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextFieldName.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextFieldName.java @@ -219,7 +219,31 @@ public enum TextFieldName { *
* @since SmartDeviceLink 7.0.0
*/
- subtleAlertSoftButtonText;
+ subtleAlertSoftButtonText,
+ /**
+ * Secondary text for AddCommand
+ *
+ * @since SmartDeviceLink 7.1.0
+ */
+ menuCommandSecondaryText,
+ /**
+ * Tertiary text for AddCommand
+ *
+ * @since SmartDeviceLink 7.1.0
+ */
+ menuCommandTertiaryText,
+ /**
+ * Secondary text for AddSubMenu
+ *
+ * @since SmartDeviceLink 7.1.0
+ */
+ menuSubMenuSecondaryText,
+ /**
+ * Tertiary text for AddSubMenu
+ *
+ * @since SmartDeviceLink 7.1.0
+ */
+ menuSubMenuTertiaryText;
/**
* Convert String to TextFieldName
|