public class SrnRichNotification extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SrnRichNotification.AlertType
Indicates how the notification will be alerted on the wearable device.
|
static class |
SrnRichNotification.PopupType
Indicates whether the notification will be alerted with a popup or not.
|
Constructor and Description |
---|
SrnRichNotification(Context context)
Constructor for a new rich notification.
|
SrnRichNotification(Context context,
UUID uuid)
Constructor for a new or updated rich notification.
|
Modifier and Type | Method and Description |
---|---|
void |
addAction(SrnAction action)
Adds an action that can be executed on this notification.
|
void |
addActions(List<SrnAction> actions)
Adds a list of actions that can be executed on this notification.
|
void |
addActionsWithPermissionCheck(List<SrnAction> actions)
Adds a list of actions that can be executed on this notification.
|
void |
addActionWithPermissionCheck(SrnAction action)
Adds an action that can be executed on this notification.
|
UUID |
getUuid()
Returns this rich notification's identifier.
|
void |
setAlertType(SrnRichNotification.AlertType alertType)
Sets an alert type on how user will be notified when this notification is delivered to the wearable device.
|
void |
setAlertType(SrnRichNotification.AlertType alertType,
SrnRichNotification.PopupType popupType)
Sets an alert type on how user will be notified when this notification is delivered to the wearable device.
|
void |
setAssociatedAndroidNotification(int id)
Sets the id of an Android notification that is associated with this RichNotification.
|
void |
setAssociatedAndroidNotification(int id,
String tag)
Sets the id and tag of an Android notification that is associated with this RichNotification.
|
void |
setIcon(SrnImageAsset icon)
Sets an icon for the
SrnRichNotification . |
void |
setPrimaryTemplate(SrnPrimaryTemplate template)
Sets a primary template used by this notification.
|
void |
setReadout(String title,
String readout)
Sets a
String that can be used for text-to-speech rendering on clients which support such rendering. |
void |
setSecondaryTemplate(SrnSecondaryTemplate template)
Sets a secondary template used by this notification.
|
void |
setTitle(String title)
Sets a title for the
SrnRichNotification . |
public SrnRichNotification(Context context)
context
- The Context
from which the notification is created.NullPointerException
- If context is null.public SrnRichNotification(Context context, UUID uuid)
context
- the Context
from which the notification is created.uuid
- the UUID
the rich notification should have.NullPointerException
- If either context or uuid is null.public UUID getUuid()
public void setIcon(SrnImageAsset icon)
SrnRichNotification
. This could
be an application icon.icon
- The SrnImageAsset
for the iconpublic void setTitle(String title)
SrnRichNotification
.title
- The String
for the titlepublic void setPrimaryTemplate(SrnPrimaryTemplate template)
template
- the SrnPrimaryTemplate
that the notification should use.NullPointerException
- if template is null.public void setSecondaryTemplate(SrnSecondaryTemplate template)
template
- the SrnSecondaryTemplate
that the notification should use.public void setAssociatedAndroidNotification(int id)
By setting this, the RichNotificationManager will ensure bidirectional dismiss conditions for the related RichNotification and Android Notification.
id
- the id of an associated Android Notification.public void setAssociatedAndroidNotification(int id, String tag)
By setting this, the RichNotificationManager will ensure bidirectional dismiss conditions for the related RichNotification and Android Notification.
id
- the id of the associated Android Notification.tag
- the tag of the associated Android Notification.public void addAction(SrnAction action)
The actions are treated based on priority level (the first action has the highest priority).
It is recommended to use addActionWithPermissionCheck() instead of addAction() for added security.
action
- an action that can be taken on this notificationNullPointerException
- if action is null.public void addActionWithPermissionCheck(SrnAction action)
The actions are treated based on priority level (the first action has the highest priority).
It is recommended to use addActionWithPermissionCheck() instead of addAction() for added security.
action
- an action that can be taken on this notificationNullPointerException
- if action is null.SecurityException
- if the required permission is not included in the AndroidManifest.xml file.public void addActions(List<SrnAction> actions)
The actions are treated based on priority level (the first action has the highest priority).
It is recommended to use addActionsWithPermissionCheck() instead of addActions() for added security.
actions
- a List
of actions that can be taken on this notificationNullPointerException
- if actions is null.public void addActionsWithPermissionCheck(List<SrnAction> actions)
The actions are treated based on priority level (the first action has the highest priority).
It is recommended to use addActionsWithPermissionCheck() instead of addActions() for added security.
actions
- a List
of actions that can be taken on this notificationNullPointerException
- if actions is null.SecurityException
- if the required permission is not included in the AndroidManifest.xml file.public void setReadout(String title, String readout)
String
that can be used for text-to-speech rendering on clients which support such rendering.title
- a string that will be read first during text-to-speech renderingreadout
- the string that will be read out in a text-to-speech renderingpublic void setAlertType(SrnRichNotification.AlertType alertType)
setAlertType(AlertType, PopupType)
.alertType
- one of SrnRichNotification.AlertType
.NullPointerException
- If alertType is null.public void setAlertType(SrnRichNotification.AlertType alertType, SrnRichNotification.PopupType popupType)
alertType
- one of SrnRichNotification.AlertType
.popupType
- one of SrnRichNotification.PopupType
.NullPointerException
- If either alertType or popupType is null.Copyright © Samsung Electronics, Co., Ltd. All rights reserved.