| java.lang.Object | |
| ↳ | android.preview.support.wearable.notifications.WearableNotifications |
Helper providing extensions to android notifications for use with wearable devices.
To build notifications with wearable extensions, use the WearableNotifications.Builder class.
Notifications created using Builder should be posted to the notification system
using the NotificationManagerCompat.notify(...) methods instead of
NotificationManager.notify(...).
Once a notification is built, a variety of methods are provide in this utility to access the value of various notification fields in a backwards compatible manner.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| WearableNotifications.Action | Subclass of NotificationCompat.Action which adds support for additional
wearable extensions. |
||||||||||
| WearableNotifications.Builder | Builder object that wraps a NotificationCompat.Builder to provide
methods for adding wearable extensions to a notification. |
||||||||||
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| int | GROUP_ORDER_DEFAULT | Default value for the group sort order. | |||||||||
| int | GROUP_ORDER_SUMMARY | Sentinel value provided to the groupOrder parameter setGroup(Notification, String) to indicate that
this member of a notification group is the summary of the group. |
|||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Get a
WearableNotifications.Action wrapper for the notification at index actionIndex
in the actions array. | |||||||||||
Get the number of actions present on this notification.
| |||||||||||
Get the big action icon to be displayed with this notification.
| |||||||||||
Get the big action icon subtext to be shown with a big action icon.
| |||||||||||
Gets the
RemoteInputs associated with the content intent. | |||||||||||
Gets the
extras field from a notification in a backwards
compatible manner. | |||||||||||
Get the key used to group this notification into a cluster or stack
with other notifications.
| |||||||||||
Get the sort order of this notification within a group of notifications
with the same group key set.
| |||||||||||
Get a hint that this notification's icon should not be displayed.
| |||||||||||
Get whether or not this notification is only relevant to the current device.
| |||||||||||
Get the array of additional pages of content for displaying this notification.
| |||||||||||
Add a big action display to this notification.
| |||||||||||
Add a big action display to this notification.
| |||||||||||
Sets
RemoteInputs to be collected when the user triggers the
contentIntent. | |||||||||||
Set this notification to be part of a group of notifications sharing the same key.
| |||||||||||
Set this notification to be part of a group of notifications sharing the same key.
| |||||||||||
Set a hint that this notification's icon should not be displayed.
| |||||||||||
Set whether or not this notification is only relevant to the current device.
| |||||||||||
Set the priority of this notification to be minimum priority level
(
PRIORITY_MIN). | |||||||||||
Set additional pages of content to display with this notification.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Default value for the group sort order.
Sentinel value provided to the groupOrder parameter setGroup(Notification, String) to indicate that
this member of a notification group is the summary of the group.
Get a WearableNotifications.Action wrapper for the notification at index actionIndex
in the actions array.
Get the number of actions present on this notification.
Get the big action icon to be displayed with this notification. Big actions show a hint to users about the action taken when the content intent is triggered.
Get the big action icon subtext to be shown with a big action icon.
Gets the RemoteInputs associated with the content intent.
Gets the extras field from a notification in a backwards
compatible manner. Extras field was supported from JellyBean (Api level 16)
forwards. This function will return null on older api levels.
Get the key used to group this notification into a cluster or stack with other notifications. This key is unique within a package.
Get the sort order of this notification within a group of notifications
with the same group key set. Group orders are 0-indexed integers that are used
to sort notifications in ascending order. Can also be the sentinel value
GROUP_ORDER_SUMMARY if this is the summary notification for a group.
Get a hint that this notification's icon should not be displayed.
Get whether or not this notification is only relevant to the current device.
Some notifications can be bridged to other devices for remote display. If this hint is set, it is recommended that this notification not be bridged.
Get the array of additional pages of content for displaying this notification. The current notification forms the first page, and elements within this array form subsequent pages. This field can be used to separate a notification into multiple sections.
Add a big action display to this notification. Big actions show a hint to users about the action taken when the content intent is triggered.
| icon | Icon to display for the content action. |
|---|
Add a big action display to this notification. Big actions show a hint to users about the action taken when the content intent is triggered.
| icon | Icon to display for the content action. |
|---|---|
| subtext | Optional subtext to display with the big action icon. |
Sets RemoteInputs to be collected when the user triggers the
contentIntent. These function just as if they were attached to
an WearableNotifications.Action.
Set this notification to be part of a group of notifications sharing the same key. Grouped notifications may display in a cluster or stack on devices which support such rendering. Use the default ordering within a group.
| groupKey | The group key of the group. Unique within a package. |
|---|
Set this notification to be part of a group of notifications sharing the same key. Grouped notifications may display in a cluster or stack on devices which support such rendering.
| groupKey | The group key of the group. Unique within a package. |
|---|---|
| groupOrder | The 0-indexed sort order within the group. Can also be set
to the sentinel value GROUP_ORDER_SUMMARY to mark this
notification as being the group summary.
|
Set a hint that this notification's icon should not be displayed.
Set whether or not this notification is only relevant to the current device.
Some notifications can be bridged to other devices for remote display. This hint can be set to recommend this notification not be bridged.
Set the priority of this notification to be minimum priority level
(PRIORITY_MIN). When set via WearableNotifications, these
minimum priority notifications will bypass the notification manager on platforms
that do not support ambient level notifications.
Set additional pages of content to display with this notification. The current notification forms the first page, and pages set using this function form subsequent pages. This field can be used to separate a notification into multiple sections.