diff options
author | Bilal Alsharifi <bilal.alsharifi@gmail.com> | 2019-07-16 11:35:04 -0400 |
---|---|---|
committer | Bilal Alsharifi <bilal.alsharifi@gmail.com> | 2019-07-16 11:35:04 -0400 |
commit | fac1d030bcbde0f9c1ea21075d9c0d57c701e40e (patch) | |
tree | 5c5841df26a5b558bf9d91921a057ed1c6192b3f | |
parent | 95b0b1b975139120c9b098bd4f036852a5ad6adb (diff) | |
download | sdl_android-fac1d030bcbde0f9c1ea21075d9c0d57c701e40e.tar.gz |
Add icon to Alert RPC
-rw-r--r-- | base/src/main/java/com/smartdevicelink/proxy/rpc/Alert.java | 93 | ||||
-rw-r--r-- | base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ImageFieldName.java | 68 |
2 files changed, 99 insertions, 62 deletions
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Alert.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Alert.java index 1490a48f1..2dfe59adf 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Alert.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Alert.java @@ -1,34 +1,34 @@ -/* - * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ +/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
package com.smartdevicelink.proxy.rpc;
import com.smartdevicelink.protocol.enums.FunctionID;
@@ -136,6 +136,14 @@ import java.util.List; * <td></td>
* <td>SmartDeviceLink 1.0</td>
* </tr>
+ * <tr>
+ * <td>alertIcon</td>
+ * <td>Image</td>
+ * <td>Image struct determining whether static or dynamic icon. If omitted on supported displays, no (or the default if applicable) icon should be displayed.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 6.0.0</td>
+ * </tr>
* </table>
* @since SmartDeviceLink 1.0
*
@@ -154,6 +162,7 @@ public class Alert extends RPCRequest { public static final String KEY_PROGRESS_INDICATOR = "progressIndicator";
public static final String KEY_TTS_CHUNKS = "ttsChunks";
public static final String KEY_SOFT_BUTTONS = "softButtons";
+ public static final String KEY_ALERT_ICON = "alertIcon";
/**
* Constructs a new Alert object
@@ -374,4 +383,26 @@ public class Alert extends RPCRequest { public void setProgressIndicator(Boolean progressIndicator) {
setParameters(KEY_PROGRESS_INDICATOR, progressIndicator);
}
+
+ /**
+ * <p>Sets the Image
+ * If provided, defines the image to be shown along with the alert</p>
+ * @param alertIcon
+ * <p>an Image object representing the Image shown along with the alert</p>
+ * <p>
+ * <b>Notes: </b>If omitted on supported displays, no (or the
+ * default if applicable) icon will be displayed</p>
+ */
+ public void setAlertIcon(Image alertIcon) {
+ setParameters(KEY_ALERT_ICON, alertIcon);
+ }
+
+ /**
+ * <p>Gets the image to be shown along with the alert </p>
+ *
+ * @return Image -an Image object
+ */
+ public Image getAlertIcon() {
+ return (Image) getObject(Image.class, KEY_ALERT_ICON);
+ }
}
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 c88591a23..9c7aa2722 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 @@ -1,34 +1,34 @@ -/* - * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ +/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
package com.smartdevicelink.proxy.rpc.enums;
/**
* The name that identifies the field.
@@ -103,6 +103,12 @@ public enum ImageFieldName { * @since SmartDeviceLink 5.0
*/
secondaryGraphic,
+ /**
+ * The image field for Alert
+ *
+ * @since SmartDeviceLink 6.0.0
+ */
+ alertIcon,
;
/**
|