diff options
| author | 2012-10-12 14:17:03 -0700 | |
|---|---|---|
| committer | 2012-10-12 14:17:03 -0700 | |
| commit | 6b77a76d3f8f04a4faf53c95acdbaeccafe3cf72 (patch) | |
| tree | 764aa26b5faf630f2e1226a3ec9b9d46a259f51e | |
| parent | 4c38e24afb0fe68d6e9f6e924e6426808be2611a (diff) | |
| parent | 5dc7ac745300fb043267a0c9235244a115507c51 (diff) | |
am 5dc7ac74: am a7b56a20: am e249763d: small update to Toast guide, flatten sidenav for notifications/toasts, new screenshots for notifications
* commit '5dc7ac745300fb043267a0c9235244a115507c51':
small update to Toast guide, flatten sidenav for notifications/toasts, new screenshots for notifications
| -rw-r--r-- | docs/html/guide/guide_toc.cs | 25 | ||||
| -rw-r--r-- | docs/html/guide/topics/ui/notifiers/notifications.jd | 60 | ||||
| -rw-r--r-- | docs/html/guide/topics/ui/notifiers/toasts.jd | 52 | ||||
| -rw-r--r-- | docs/html/images/toast.png | bin | 6544 -> 47415 bytes | |||
| -rw-r--r-- | docs/html/images/ui/notifications/iconic_notification.png | bin | 6733 -> 21823 bytes | |||
| -rw-r--r-- | docs/html/images/ui/notifications/normal_notification.png | bin | 26962 -> 59021 bytes | |||
| -rw-r--r-- | docs/html/images/ui/notifications/normal_notification_callouts.png | bin | 18330 -> 24898 bytes |
7 files changed, 64 insertions, 73 deletions
diff --git a/docs/html/guide/guide_toc.cs b/docs/html/guide/guide_toc.cs index e812ccbc7b25..46c4398c0699 100644 --- a/docs/html/guide/guide_toc.cs +++ b/docs/html/guide/guide_toc.cs @@ -191,28 +191,21 @@ <li><a href="<?cs var:toroot ?>guide/topics/ui/menus.html"> <span class="en">Menus</span></span> </a></li> - <li><a href="<?cs var:toroot ?>guide/topics/ui/dialogs.html"> - <span class="en">Dialogs</span> - </a></li> <li><a href="<?cs var:toroot ?>guide/topics/ui/actionbar.html"> <span class="en">Action Bar</span> </a></li> <li><a href="<?cs var:toroot ?>guide/topics/ui/settings.html"> <span class="en">Settings</span> </a></li> - <li class="nav-section"> - <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/ui/notifiers/index.html"> - <span class="en">Notifications</span> - </a></div> - <ul> - <li><a href="<?cs var:toroot ?>guide/topics/ui/notifiers/toasts.html"> - <span class="en">Toast Notifications</span> - </a></li> - <li><a href="<?cs var:toroot ?>guide/topics/ui/notifiers/notifications.html"> - <span class="en">Status Notifications</span> - </a></li> - </ul> - </li> + <li><a href="<?cs var:toroot ?>guide/topics/ui/dialogs.html"> + <span class="en">Dialogs</span> + </a></li> + <li><a href="<?cs var:toroot ?>guide/topics/ui/notifiers/notifications.html"> + <span class="en">Notifications</span> + </a></li> + <li><a href="<?cs var:toroot ?>guide/topics/ui/notifiers/toasts.html"> + <span class="en">Toasts</span> + </a></li> <li class="nav-section"> <div class="nav-section-header"><a href="<?cs var:toroot ?>guide/topics/search/index.html"> <span class="en">Search</span> diff --git a/docs/html/guide/topics/ui/notifiers/notifications.jd b/docs/html/guide/topics/ui/notifiers/notifications.jd index fbff532dc165..2de62607ed0d 100644 --- a/docs/html/guide/topics/ui/notifiers/notifications.jd +++ b/docs/html/guide/topics/ui/notifiers/notifications.jd @@ -4,26 +4,43 @@ page.title=Notifications <div id="qv-wrapper"> <div id="qv"> <h2>In this document</h2> +<ol> + <li><a href="#NotificationUI">Notification Display Elements</a> <ol> - <li> - <a href="#NotificationUI">Notification Display Elements</a> - </li> - <li> - <a href="#CreateNotification">Creating a Notification</a> - </li> - <li> - <a href="#Managing">Managing Notifications</a> - </li> - <li> - <a href="#NotificationResponse">Preserving Navigation when Starting an Activity</a> - </li> - <li> - <a href="#Progress">Displaying Progress in a Notification</a> - </li> - <li> - <a href="#CustomNotification">Custom Notification Layouts</a> - </li> + <li><a href="#NormalNotify">Normal view</a></li> + <li><a href="#BigNotify">Big view</a></li> + </ol> + </li> + <li><a href="#CreateNotification">Creating a Notification</a> + <ol> + <li><a href="#Required">Required notification contents</a></li> + <li><a href="#Optional">Optional notification contents and settings</a></li> + <li><a href="#Actions">Notification actions</a></li> + <li><a href="#SimpleNotification">Creating a simple notification</a></li> + <li><a href="#ApplyStyle">Applying a big view style to a notification</a></li> + </ol> + </li> + <li><a href="#Managing">Managing Notifications</a> + <ol> + <li><a href="#Updating">Updating notifications</a></li> + <li><a href="#Removing">Removing notifications</a></li> + </ol> + </li> + <li><a href="#NotificationResponse">Preserving Navigation when Starting an Activity</a> + <ol> + <li><a href="#DirectEntry">Setting up a regular activity PendingIntent</a></li> + <li><a href="#ExtendedNotification">Setting up a special activity PendingIntent</a></li> + </ol> + </li> + <li><a href="#Progress">Displaying Progress in a Notification</a> + <ol> + <li><a href="#FixedProgress">Displaying a fixed-duration progress indicator</a></li> + <li><a href="#ActivityIndicator">Displaying a continuing activity indicator</a></li> </ol> + </li> + <li><a href="#CustomNotification">Custom Notification Layouts</a></li> +</ol> + <h2>Key classes</h2> <ol> <li>{@link android.app.NotificationManager}</li> @@ -54,13 +71,12 @@ page.title=Notifications <img id="figure1" src="{@docRoot}images/ui/notifications/iconic_notification.png" - height="32" - alt="" /> + height="120" alt="" /> <p class="img-caption"> <strong>Figure 1.</strong> Notifications in the notification area. </p> <img id="figure2" src="{@docRoot}images/ui/notifications/normal_notification.png" - height="240" alt="" /> + height="293" alt="" /> <p class="img-caption"> <strong>Figure 2.</strong> Notifications in the notification drawer. </p> @@ -98,7 +114,7 @@ page.title=Notifications <img src="{@docRoot}images/ui/notifications/normal_notification_callouts.png" alt="" - height="204" + height="153" id="figure3" /> <p class="img-caption"> <strong>Figure 3.</strong> Notification in normal view. diff --git a/docs/html/guide/topics/ui/notifiers/toasts.jd b/docs/html/guide/topics/ui/notifiers/toasts.jd index 1a1fb1ff875b..92c146a742ae 100644 --- a/docs/html/guide/topics/ui/notifiers/toasts.jd +++ b/docs/html/guide/topics/ui/notifiers/toasts.jd @@ -1,17 +1,8 @@ -page.title=Toast Notifications -parent.title=Notifications -parent.link=index.html +page.title=Toasts @jd:body <div id="qv-wrapper"> - <div id="qv"> - <h2>Quickview</h2> - <ol> - <li>A toast is a message that appears on the surface of the screen for a moment, but it -does not take focus (or pause the current activity), so it cannot accept user input</li> - <li>You can customize the toast layout to include images</li> - </ol> - + <div id="qv"> <h2>In this document</h2> <ol> <li><a href="#Basics">The Basics</a></li> @@ -26,22 +17,17 @@ does not take focus (or pause the current activity), so it cannot accept user in </div> </div> -<p>A toast notification is a message that pops up on the surface of the window. -It only fills the amount of space required for the message and the user's current -activity remains visible and interactive. The notification automatically fades in and -out, and does not accept interaction events.</p> +<p>A toast provides simple feedback about an operation in a small popup. +It only fills the amount of space required for the message and the current +activity remains visible and interactive. +For example, navigating away from an email before you send it triggers a +"Draft saved" toast to let you know that you can continue editing later. +Toasts automatically disappear after a timeout.</p> -<p>The screenshot below shows an example toast notification from the Alarm application. -Once an alarm is turned on, a toast is displayed to assure you that the -alarm was set.</p> <img src="{@docRoot}images/toast.png" alt="" /> -<p>A toast can be created and displayed from an {@link android.app.Activity} or -{@link android.app.Service}. If you create a toast notification from a Service, it -appears in front of the Activity currently in focus.</p> - -<p>If user response to the notification is required, consider using a -<a href="notifications.html">Status Bar Notification</a>.</p> +<p>If user response to a status message is required, consider instead using a +<a href="{@docRoot}guide/topics/ui/notifiers/notifications.html">Notification</a>.</p> <h2 id="Basics">The Basics</h2> @@ -90,8 +76,6 @@ To nudge it down, increase the value of the last parameter. <h2 id="CustomToastView">Creating a Custom Toast View</h2> -<img src="{@docRoot}images/custom_toast.png" alt="" style="float:right" /> - <p>If a simple text message isn't enough, you can create a customized layout for your toast notification. To create a custom layout, define a View layout, in XML or in your application code, and pass the root {@link android.view.View} object @@ -105,17 +89,17 @@ with the following XML (saved as <em>toast_layout.xml</em>):</p> android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" - android:padding="10dp" + android:padding="8dp" android:background="#DAAA" > - <ImageView android:id="@+id/image" + <ImageView android:src="@drawable/droid" android:layout_width="wrap_content" - android:layout_height="fill_parent" - android:layout_marginRight="10dp" + android:layout_height="wrap_content" + android:layout_marginRight="8dp" /> <TextView android:id="@+id/text" android:layout_width="wrap_content" - android:layout_height="fill_parent" + android:layout_height="wrap_content" android:textColor="#FFF" /> </LinearLayout> @@ -126,13 +110,11 @@ ID to inflate the layout from the XML, as shown here:</p> <pre> LayoutInflater inflater = getLayoutInflater(); -View layout = inflater.inflate(R.layout.toast_layout, +View layout = inflater.inflate(R.layout.custom_toast, (ViewGroup) findViewById(R.id.toast_layout_root)); -ImageView image = (ImageView) layout.findViewById(R.id.image); -image.setImageResource(R.drawable.android); TextView text = (TextView) layout.findViewById(R.id.text); -text.setText("Hello! This is a custom toast!"); +text.setText("This is a custom toast"); Toast toast = new Toast(getApplicationContext()); toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0); diff --git a/docs/html/images/toast.png b/docs/html/images/toast.png Binary files differindex 223048a39614..b4c709ac2b48 100644 --- a/docs/html/images/toast.png +++ b/docs/html/images/toast.png diff --git a/docs/html/images/ui/notifications/iconic_notification.png b/docs/html/images/ui/notifications/iconic_notification.png Binary files differindex 4cabfdbe0a44..e72fe4e86b1b 100644 --- a/docs/html/images/ui/notifications/iconic_notification.png +++ b/docs/html/images/ui/notifications/iconic_notification.png diff --git a/docs/html/images/ui/notifications/normal_notification.png b/docs/html/images/ui/notifications/normal_notification.png Binary files differindex 3cf02311be4c..9bea5fb5196d 100644 --- a/docs/html/images/ui/notifications/normal_notification.png +++ b/docs/html/images/ui/notifications/normal_notification.png diff --git a/docs/html/images/ui/notifications/normal_notification_callouts.png b/docs/html/images/ui/notifications/normal_notification_callouts.png Binary files differindex db57dafbe0f2..6880e90c0f96 100644 --- a/docs/html/images/ui/notifications/normal_notification_callouts.png +++ b/docs/html/images/ui/notifications/normal_notification_callouts.png |