From dae3ef91fb110ad7c441ab1d7f7aaa2b1bd0e530 Mon Sep 17 00:00:00 2001 From: David Friedman Date: Fri, 4 Mar 2016 14:36:27 -0800 Subject: [PATCH] Docs: Notification features for N (cont. from http://ag/873978). See comments for doc stage location. bug: 26645465 Change-Id: Iae66c4033fd95b37566f8b8aabbd04b6a57ae5ec --- .../preview/features/notification-updates.jd | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/docs/html/preview/features/notification-updates.jd b/docs/html/preview/features/notification-updates.jd index f408ec06427b6..56e5c79249b80 100644 --- a/docs/html/preview/features/notification-updates.jd +++ b/docs/html/preview/features/notification-updates.jd @@ -20,16 +20,16 @@ trainingnavtop=true -

Android N Developer Preview introduces several new APIs that allow apps to post +

The Android N Developer Preview introduces several new APIs that allow apps to post notifications that are highly visible and interactive.

-

The Android N Developer Preview extends the existing {@link android.support.v4.app.RemoteInput} +

The Preview extends the existing {@link android.support.v4.app.RemoteInput} notification API to support inline replies on handsets. This feature allows users to quickly respond from the notification shade without visiting your app.

- The N Developer Preview also allows you to bundle similar notifications to - appear as a single notification. To make this possible, the N Developer + The Preview also allows you to bundle similar notifications to + appear as a single notification. To make this possible, the Preview uses the existing {@link android.support.v4.app.NotificationCompat.Builder#setGroup NotificationCompat.Builder.setGroup()} method. Users can expand each of the @@ -37,7 +37,7 @@ notification API to support inline replies on handsets. This feature allows user notifications, individually from the notification shade.

-

Last, the N Developer Preview also adds two new custom view style APIs that +

Last, the Preview also adds two new custom view style APIs that allow you to leverage system decorations in your app’s customized notification views.

@@ -46,7 +46,7 @@ views.

Direct Reply

-

With the Direct Reply feature in the N Developer Preview, users can quickly +

With the Direct Reply feature in the Preview, users can quickly respond to text messages or update task lists directly within the notification interface. On a handheld, the inline reply action appears as an additional button attached to the notification. When a user replies via keyboard, the system attaches @@ -57,7 +57,7 @@ interface. On a handheld, the inline reply action appears as an additional butto

- Figure 1. N Developer Preview adds Reply + Figure 1. The Preview adds the Reply action button.

@@ -182,29 +182,29 @@ When the user responds via {@link android.support.v4.app.RemoteInput},

Bundled Notifications

-

The Android N Developer preview provides developers with a new way to represent +

The Preview provides developers with a new way to represent a queue of notifications: bundled notifications. This is similar to the Notification Stacks feature in Android Wear. For example, if your app creates notifications for received messages, when more than one message is received, bundle the - notifications together as a single group.You can - use the existing {@link android.support.v4.app.NotificationCompat.Builder#setGroup} -Builder.setGroup()} - method to bundle similar notifications.

+ notifications together as a single group. You can + use the existing {@link android.support.v4.app.NotificationCompat.Builder#setGroup +Builder.setGroup()} method to bundle similar notifications.

-

A notification group imposes a hierarchy on the notifications comprising it. - At the top of that hierarchy is a parent notification that serves as a summary of - the group. The subsequent lines list the contents of the child - notifications. The user can expand the bundle to view its notifications. The user - can then select a notification within its bundle and perform one of its - actions, like "reply" or "dismiss". -

+

+ A notification group imposes a hierarchy on the notifications comprising it. + At the top of that hierarchy is a parent notification that displays the first + line of the first notification in the group. The user can progressively + expand the notification group, and the system shows more information as the + user drills deeper. When the user expands the bundle, the system reveals the + first line of each notification within the bundle; when the user expands one + of those notifications, the system reveals its entire content. +

- Figure 4. The user can expand a bundle to see its - notifications, then expand one of those notifications to use one of its - actions. + Figure 4. The user can progressively expand the notification + group.

To learn how to add notifications to a group, see @@ -215,7 +215,7 @@ Each Notification to a Group.

Best practices for bundled notifications

This section provides guidelines about when to use notification groups instead of the {@link android.app.Notification.InboxStyle} notifications that have been available - in the earlier versions of the Android platform.

+ in earlier versions of the Android platform.

When to use bundled notifications

You should use notification groups only if all of the following conditions are @@ -264,8 +264,8 @@ single child left. It should then convert the child into a normal, single

Backwards compatibility

-

On handhelds, notification groups are available beginning from Android N Developer -preview. However, on tablets, the notification groups API has been available since +

On handhelds, notification groups are available beginning from this +Preview. However, on tablets, the notification groups API has been available since Android Android 5.0 (API level 21).

All Android Wear devices have this feature, regardless of API level. @@ -281,11 +281,13 @@ For convenience, an app can usually reuse the notification group summary and def

Custom Views

-

Starting from the N Developer Preview, you can customize notification views and +

Starting from this Preview, you can customize notification views and still obtain system decorations like notification headers, actions, and expandable layouts.

-

To enable this capability, Android N adds the following custom view style APIs:

+

To enable this capability, Android N adds the following APIs to style your + custom view:

+
{@code DecoratedCustomViewStyle()}