summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBilal <bilal@Bilals-MBP.localdomain>2018-06-25 09:17:13 -0400
committerBilal <bilal@Bilals-MBP.localdomain>2018-06-25 09:17:13 -0400
commit765cecaf839e6943bcab85ecc11596ed9e8cdf12 (patch)
tree55a77bfb7afb36980a11931ff1b5a22c779b077e
parent9d7345d7c724ef82f5cdfe571dc22efb5c634989 (diff)
downloadsdl_android-765cecaf839e6943bcab85ecc11596ed9e8cdf12.tar.gz
add an icon image to AddSubMenu
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java32
-rw-r--r--sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java26
2 files changed, 52 insertions, 6 deletions
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java
index ea55702bd..1b3806fc9 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java
@@ -4806,28 +4806,47 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
addCommand(commandID, null, null, null, vrCommands, correlationID);
}
-
-
+
/**
* Sends an AddSubMenu RPCRequest to SDL. Responses are captured through callback on IProxyListener.
- *
+ *
* @param menuID -Unique ID of the sub menu to add.
* @param menuName -Text to show in the menu for this sub menu.
* @param position -Position within the items that are are at top level of the in application menu.
+ * @param menuIcon -Image to be be shown along with the submenu item
* @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
* @throws SdlException if an unrecoverable error is encountered
*/
@SuppressWarnings("SameParameterValue")
public void addSubMenu(@NonNull Integer menuID, @NonNull String menuName,
- Integer position, Integer correlationID)
+ Integer position, Image menuIcon, Integer correlationID)
throws SdlException {
AddSubMenu msg = new AddSubMenu(menuID, menuName);
msg.setCorrelationID(correlationID);
msg.setPosition(position);
-
+ msg.setMenuIcon(menuIcon);
+
sendRPCRequest(msg);
}
+
+ /**
+ * Sends an AddSubMenu RPCRequest to SDL. Responses are captured through callback on IProxyListener.
+ *
+ * @param menuID -Unique ID of the sub menu to add.
+ * @param menuName -Text to show in the menu for this sub menu.
+ * @param position -Position within the items that are are at top level of the in application menu.
+ * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
+ * @throws SdlException if an unrecoverable error is encountered
+ */
+ @Deprecated
+ @SuppressWarnings("SameParameterValue")
+ public void addSubMenu(@NonNull Integer menuID, @NonNull String menuName,
+ Integer position, Integer correlationID)
+ throws SdlException {
+
+ addSubMenu(menuID, menuName, position, null, correlationID);
+ }
/**
* Sends an AddSubMenu RPCRequest to SDL. Responses are captured through callback on IProxyListener.
@@ -4837,11 +4856,12 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
* @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse
* @throws SdlException if an unrecoverable error is encountered
*/
+ @Deprecated
@SuppressWarnings("unused")
public void addSubMenu(Integer menuID, String menuName,
Integer correlationID) throws SdlException {
- addSubMenu(menuID, menuName, null, correlationID);
+ addSubMenu(menuID, menuName, null, null, correlationID);
}
/*Begin V1 Enhanced helper*/
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java
index b61a28772..b4bd19473 100644
--- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java
+++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java
@@ -50,6 +50,14 @@ import java.util.Hashtable;
* <td>maxlength:500</td>
* <td>SmartDeviceLink 1.0</td>
* </tr>
+ * <tr>
+ * <td>menuIcon</td>
+ * <td>Image</td>
+ * <td>Image to be be shown along with the submenu item</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 4.6</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>
@@ -66,6 +74,7 @@ public class AddSubMenu extends RPCRequest {
public static final String KEY_POSITION = "position";
public static final String KEY_MENU_NAME = "menuName";
public static final String KEY_MENU_ID = "menuID";
+ public static final String KEY_MENU_ICON = "menuIcon";
/**
* Constructs a new AddSubMenu object
@@ -166,4 +175,21 @@ public class AddSubMenu extends RPCRequest {
public void setMenuName( @NonNull String menuName ) {
setParameters(KEY_MENU_NAME, menuName);
}
+ /**
+ * Returns Image to be be shown along with the submenu item
+ *
+ * @return Image - the submenu icon
+ */
+ public Image getMenuIcon() {
+ return (Image) getObject(Image.class, KEY_MENU_ICON);
+ }
+ /**
+ * Sets image to be be shown along with the submenu item
+ *
+ * @param menuIcon
+ * Image to be be shown along with the submenu item
+ */
+ public void setMenuIcon(Image menuIcon) {
+ setParameters(KEY_MENU_ICON, menuIcon);
+ }
}