Patterns Notifications

Notifications

Android only

Notifications inform your app’s users about relevant and timely events in your app.

You can create notifications to draw attention to messages from friends, alert a commuter to traffic slowdowns, show the progress of a new app being installed, and more.

As they can be interruptive, use notifications judiciously.

Notifications should be synced to all of a user’s devices.

Notification components

Icon of the app generating the notification
Title
Secondary text
Timestamp

How notifications are prioritized

Timestamp
Stated priority level
Last notification time
Contacts

Usage Expand and collapse content An arrow that points down when collapsed and points up when expanded.

Minimize interruption

Notifications inform users about events in your app while the user is focused elsewhere. As they can be interruptive, use notifications judiciously.

Notifications should not be used for:

  • Information that is currently on screen (such as an active chat conversation)
  • Technical operations that don’t require user involvement (such as syncing)
  • Transient error states that can be resolved without user action

Make notifications optional

Users should always be in control of notifications. Allow users to disable or change notifications in your app’s settings.

Guidelines Expand and collapse content An arrow that points down when collapsed and points up when expanded.

Prioritize social interactions

Use notifications for events that involve other people.

Do.

An incoming chat involves a user actively waiting for a response.

Be timely

Notify the user about time-sensitive information directed specifically at them.

Don't.

Social network updates rarely warrant interruption, unless the user has specifically opted in. Status updates where the user doesn’t need to take an action, such as a routine action like saving a document, also don’t need immediate attention.

Personalize notifications

For notifications sent by another person, include that person's image.

Your app’s icon is shown paired with the personalized image.

Notification that shows the person who triggered the message and the content they sent.

Navigate to the right place

When the user touches a notification, enable the user to take immediate action. This may open a detail view, such as a message, or a summary view for multiple notifications.

Prioritize notifications

Android allows you to set priority flags to influence where your notification appears relative to others. This flag helps ensure that users always see the most important notifications first. You can choose from the following notification priority levels.

MAX, HIGH, and DEFAULT priority levels:

  • Involve another person
  • Are time-sensitive
  • Might immediately change the user's behavior in the real world

LOW and MIN priority levels:

  • Don't involve other people
  • Aren't time sensitive
  • Contain content the user might be interested in but could choose to browse at their leisure

Priority

Use

MAX

For critical and urgent notifications that alert the user to a condition that is time-critical or needs to be resolved before they can continue with a particular task.

HIGH

Primarily for important communication, such as messages or chat events with content that is particularly interesting for the user. High-priority notifications trigger the heads-up notification display.

DEFAULT

For all notifications that don't fall into any of the other priorities described here.

LOW

For notifications that you want the user to be informed about, but that are less urgent. Low-priority notifications tend to show up at the bottom of the list. They are a good choice for public or undirected social updates. The user has asked to be notified about these notifications but they should never take precedence over urgent or direct communication.

MIN

For contextual or background information such as weather or contextual location information. Minimum-priority notifications do not appear in the status bar. The user discovers them on expanding the notification shade.

Choose from the above priority levels when posting a notification.

Categorize notifications

Assign your notification to the most suitable predefined category. The system UI may use this information to make ranking and filtering decisions.

Category

Description

CATEGORY_CALL

Incoming call (voice or video) or similar synchronous communication request

CATEGORY_MESSAGE

Incoming direct message (SMS, instant message, etc.)

CATEGORY_EMAIL

Asynchronous bulk message (email)

CATEGORY_EVENT

Calendar event

CATEGORY_PROMO

Promotion or advertisement

CATEGORY_ALARM

Alarm or timer

CATEGORY_PROGRESS

Progress of a long-running background operation

CATEGORY_SOCIAL

Social network or sharing update

CATEGORY_ERROR

Error in background operation or authentication status

CATEGORY_TRANSPORT

Media transport control for playback

CATEGORY_SYSTEM

System or device status update. Reserved for system use.

CATEGORY_SERVICE

Indication of running background service

CATEGORY_RECOMMENDATION

A specific, timely recommendation for a single thing. For example, a news app might recommend a news story the user might want to read next.

CATEGORY_STATUS

Ongoing information about device or contextual status

Summarize notifications

If multiple notifications of the same type are available, combine them into a single summary notification. A summary shows how many notifications of a particular kind are pending.

Do.

You can provide more detail about notifications in a summary with the expanded digest layout.

Expanded and contracted notification that is a summary (using InboxStyle)

Use distinct icons

Pending notification icons should be recognizable in the system bar.

Notification icons should:

  • Be distinct from existing Android notification icons
  • Follow guidelines for system icon styling
  • Be visually simple
  • Be opaque white, using only the alpha channel
  • Have a transparent background

They may have anti-aliased edges.

Notification icons should not:

  • Add alpha (dimming or fading)
  • Use color
  • Have opaque backgrounds
Don't.
Don't.

Content Expand and collapse content An arrow that points down when collapsed and points up when expanded.

Base layout

All notifications must include the following elements:

  • The icon of the originating app
  • A title and secondary text
  • A timestamp

Notification type may be included if needed.

Notification containing the notification icon, title, additional text, and a timestamp. Layouts personalized with sender information may pair the app’s icon with the sender’s photo.

All notification types (top example):

Left and right margins: 8dp
Title top margin: 16dp
Title bottom margin: 8dp
Icon top and bottom padding: 12dp
Icon area width: 72dp

Additional text bottom margin: 16dp

Personalized notifications (middle example):

Left and right margins: 8dp
Title top margin: 16dp
Title bottom margin: 8dp
Icon top padding: 12dp

Icon bottom padding: 8dp
Icon area width: 72dp

Additional text bottom margin: 16dp

Summary notifications (bottom example):

Left and right margins: 8dp
Title top margin: 16dp
Title bottom margin: 8dp
Icon top and bottom margin: 12dp
Icon area width: 72dp

Title bottom margin: 8dp

Sender top and bottom margin: 12dp



Expanded layouts

You can choose how much detail your app's notification provides, such as:

  • The first few lines of a message
  • A large image preview
  • A message in its entirety

The user can pinch open or drag to change from a compact layout to an expanded layout.

For individual notifications, Android provides three expanded layout templates: text, inbox, and image.

Single-event notification on a handheld and wearable device.

Summary notification on a handheld and wearable device

Expanded notification on a handheld device

Actions

Android displays actions for common tasks at the bottom of a notification. Users can quickly handle the most common tasks for a particular notification from here without opening the originating application.

Actions should:

  • Be time-sensitive and meaningful
  • Suit the content
  • Allow the user to accomplish tasks

Actions should not:

  • Be ambiguous
  • Duplicate the default action (such as "Read" or "Open")

Specifications:

  • Maximum three actions per notification
  • Each action has an icon and a name
  • Actions are visible for expanded notifications, but otherwise hidden

Notification with two actions

Timestamps

The notification timestamp should indicate when the event occurred. A timestamp should not be set to when the notification is posted, unless that time is equivalent to the event time.

Behavior Expand and collapse content An arrow that points down when collapsed and points up when expanded.

Notifications are indicated by icons in the status bar, accessible through the notification drawer. Touching a notification opens the associated app. Swiping left or right on a notification removes it from the drawer.

Ongoing notifications

Ongoing notifications keep users informed about background processes and provide status for longer tasks, such as file downloads.

A user cannot manually remove an ongoing notification from the notification drawer.

Music players announce the currently playing track in the notification system until the user stops playback.

Media playback

When an app provides ongoing notifications for active media, users may control playback even when that app is not in the foreground or the screen is locked.

Ranking and ordering

Notifications are shown in reverse-chronological order, with consideration given to the app's stated notification priority.

Notifications are featured prominently on the lock screen and should show the reason for the notification at a glance.

Android sorts notifications according to the following:

  • The timestamp and application's stated priority
  • Whether the notification has recently notified the user with a sound or vibration
  • Any people attached to the notification and whether they are starred contacts

Hangouts notification

For a brief period immediately after it arrives, a Gmail notification may receive heightened priority after the device rings or vibrates.

After the "recently notified" period lapses, Gmail notifications are set to the default priority level. They appear below messages with higher priority levels, like instant messages from Hangouts.

Lock screen privacy

Because notifications are visible on the lock screen, user privacy is an especially important consideration. Notifications often contain sensitive information, and should not be visible to anyone who sees the display.

For devices that have a secure lock screen (PIN, pattern, or password), the public version of the interface may be displayed. The private interface is only revealed once the user has signed into the device.

This is an example of notifications on the lock screen with an SMS app whose notifications include the text of the SMS and the sender's name and contact icon. The contents are only revealed after the user unlocks the device.

User control of secure lock screen information

The user can choose to conceal sensitive details from the secure lock screen. The system evaluates each notification's visibility level to figure out what can safely be shown.

This setting allows your app to display a redacted version of the content, hiding personal information while still being useful, such as "3 new messages."

Peeking notifications Expand and collapse content An arrow that points down when collapsed and points up when expanded.

When a high-priority notification arrives, it is presented to users for a short period of time with an expanded layout exposing possible actions. The notification then retreats.

If a notification's priority is flagged as High, Max, or full-screen, it gets a peeking notification.

Good examples of peeking notifications include:

  • An incoming phone call when using a device
  • An alarm
  • A new SMS message
  • Low battery

Example of a peeking notification (incoming phone call, high priority) appearing on top of an immersive app