Crea una notificación centrada en el progreso

Notificación centrada en el progreso
Figura 1: Una notificación centrada en el progreso en la parte superior de la pantalla.

Android 16 presenta una nueva plantilla de notificación para ayudar a los usuarios a hacer un seguimiento sin problemas de los recorridos de principio a fin que inician. Estas notificaciones tendrán una visibilidad mejorada en las plataformas del sistema y una clasificación superior en el panel lateral de notificaciones.

Usa Notification.ProgressStyle para aplicar diseño a las notificaciones centradas en el progreso. Entre los casos de uso clave, se incluyen los viajes compartidos, las entregas y la navegación. Dentro de esa clase, encontrarás la capacidad de denotar estados y eventos importantes en el recorrido del usuario con puntos y segmentos.

Clases relevantes

Las siguientes clases contienen las diferentes APIs que usas para crear una notificación de ProgressStyle:

Anatomía y personalización

En las siguientes imágenes, se muestran las diferentes partes que conforman las notificaciones de ProgressStyle:

Figura 2: Las diferentes partes de un ProgressStyle notification.
Figure 3. Apps can set a vehicle image for the tracker icon and use segments and points to denote the rideshare experience and milestones.

Set up

Use the right APIs and follow best practices to provide the best user experience for progress updates.

  • Set the right fields to meet promoted visibility.
  • Use the right visual elements to guide users. For example, rideshare apps should set a vehicle image and use the most accurate color of the vehicle in the notification using Notification#setLargeIcon.
  • Use concise and clear language to define the progress of the user journey. Time of arrival, driver name, and state of the journey are important text that the notification should communicate.
  • Provide useful and relevant actions in the notification that streamline the user journey. For example, providing "Tip" and "Add dish" to a newly initiated food delivery order are useful actions before delivery.
  • Use segments and points to denote states. For example, segments can colorize the state and duration of traffic in a rideshare journey. Points represent states for milestones such as food preparation, delivery, and passenger pickup.
  • Update the progress experience to accurately reflect the actual progression of the journey. For example, changes in traffic conditions can be reflected in changes in segment colors and updates in text.

The following example shows a ProgressStyle notification for a rideshare app.

The example shows the use of a vehicle image for the tracker icon. It also shows the use of segments and points to denote the rideshare experience and milestones.

See the sample app to experiment with these APIs.