Trevor Johns | a6b4636 | 2013-10-30 16:38:01 -0700 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <!-- |
| 3 | Copyright 2013 The Android Open Source Project |
| 4 | |
| 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | you may not use this file except in compliance with the License. |
| 7 | You may obtain a copy of the License at |
| 8 | |
| 9 | http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 11 | Unless required by applicable law or agreed to in writing, software |
| 12 | distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | See the License for the specific language governing permissions and |
| 15 | limitations under the License. |
| 16 | --> |
| 17 | <sample> |
| 18 | <name>CustomNotifications</name> |
Renato Mangini | ebeca0e | 2014-11-11 17:55:39 -0800 | [diff] [blame] | 19 | <group>Notification</group> |
Trevor Johns | a6b4636 | 2013-10-30 16:38:01 -0700 | [diff] [blame] | 20 | <package>com.example.android.customnotifications</package> |
| 21 | |
| 22 | <!-- change minSdk if needed--> |
| 23 | <minSdk>4</minSdk> |
| 24 | |
| 25 | <strings> |
| 26 | <intro> |
| 27 | <![CDATA[ |
| 28 | This sample demonstrates notifications with custom content views. |
| 29 | ]]> |
| 30 | </intro> |
| 31 | </strings> |
| 32 | |
Arthur Thompson | 13e97e4 | 2014-11-26 17:35:19 -0800 | [diff] [blame] | 33 | <metadata> |
| 34 | <status>PUBLISHED</status> |
| 35 | <categories>Notification, UI</categories> |
| 36 | <technologies>Android</technologies> |
| 37 | <languages>Java</languages> |
| 38 | <solutions>Mobile</solutions> |
| 39 | <level>BEGINNER</level> |
| 40 | <icon>screenshots/icon-web.png</icon> |
| 41 | <screenshots> |
| 42 | <img>screenshots/main-notification.png</img> |
| 43 | <img>screenshots/notification.png</img> |
| 44 | </screenshots> |
| 45 | <api_refs> |
| 46 | <android>android.app.Notification</android> |
| 47 | <android>android.app.NotificationManager</android> |
| 48 | <android>android.app.PendingIntent</android> |
| 49 | <android>android.support.v4.app.NotificationCompat</android> |
| 50 | <android>android.widget.RemoteViews</android> |
| 51 | </api_refs> |
| 52 | <description> |
| 53 | <![CDATA[ |
| 54 | This sample demonstrates notifications with custom content views. |
| 55 | The use of collapsed and expanded notification views are shown. |
| 56 | ]]> |
| 57 | </description> |
| 58 | <intro> |
| 59 | <![CDATA[ |
| 60 | This sample demonstrates notifications with custom content views. It |
| 61 | also demonstrates the expanded notification introduced in API level 16. |
| 62 | |
| 63 | This sample shows all the required steps to create and display custom |
| 64 | notifications: |
| 65 | |
| 66 | - Create Intent to launch Activity when notification is clicked. |
| 67 | - Define custom layouts for collapsed and expanded views. |
| 68 | - Use NotificationManager's notify to show notification. |
| 69 | |
| 70 | In the sample, click on the "SHOW NOTIFICATION" button to create |
| 71 | a notification. Use two-fingered gestures up and down to collapse |
| 72 | and expand the notification. |
| 73 | ]]> |
| 74 | </intro> |
| 75 | </metadata> |
| 76 | |
Trevor Johns | a6b4636 | 2013-10-30 16:38:01 -0700 | [diff] [blame] | 77 | <template src="base"/> |
| 78 | |
| 79 | </sample> |