Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Alert icon function. #8

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public static Alert buildAlert(Vector<TTSChunk> ttsChunks,
msg.setPlayTone(playTone);
msg.setTtsChunks(ttsChunks);
msg.setSoftButtons(softButtons);

msg.setAlertIcon(icon);
return msg;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4892,7 +4892,7 @@ public void alert(String ttsText, String alertText1,
*/
public void alert(Vector<TTSChunk> ttsChunks,
String alertText1, String alertText2, String alertText3, Boolean playTone,
Integer duration, Vector<SoftButton> softButtons, Integer correlationID) throws SdlException {
Integer duration, Vector<SoftButton> softButtons, Integer correlationID,Image icon) throws SdlException {

Alert msg = new Alert();
msg.setCorrelationID(correlationID);
Expand All @@ -4903,6 +4903,7 @@ public void alert(Vector<TTSChunk> ttsChunks,
msg.setPlayTone(playTone);
msg.setTtsChunks(ttsChunks);
msg.setSoftButtons(softButtons);
msg.setAlertIcon(icon);

sendRPCRequest(msg);
}
Expand Down
24 changes: 24 additions & 0 deletions sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Alert.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,30 @@ 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_ICON = "alertIcon";

/**
* <p>Sets the Image
* If provided, defines the image to be shown along with an alert</p>
* @param alertIcon
* <p>an Image obj representing the Image obj shown along with an
* 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_ICON, alertIcon);
}

/**
* <p>Gets the image to be shown along with an alert </p>
*
* @return Image -an Image object
*/
public Image getAlertIcon() {
return (Image) getObject(Image.class, KEY_ICON);
}

/**
* Constructs a new Alert object
Expand Down