Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.
added in version 1.0.0
belongs to Maven artifact androidx.core:core:1.1.0-alpha01

NotificationCompat.DecoratedCustomViewStyle

public static class NotificationCompat.DecoratedCustomViewStyle
extends NotificationCompat.Style

java.lang.Object
   ↳ androidx.core.app.NotificationCompat.Style
     ↳ androidx.core.app.NotificationCompat.DecoratedCustomViewStyle


Notification style for custom views that are decorated by the system.

Instead of providing a notification that is completely custom, a developer can set this style and still obtain system decorations like the notification header with the expand affordance and actions.

Use NotificationCompat.Builder.setCustomContentView(RemoteViews), NotificationCompat.Builder.setCustomBigContentView(RemoteViews) and NotificationCompat.Builder.setCustomHeadsUpContentView(RemoteViews) to set the corresponding custom views to display.

To use this style with your Notification, feed it to NotificationCompat.Builder.setStyle(Style) like so:

 Notification noti = new NotificationCompat.Builder()
     .setSmallIcon(R.drawable.ic_stat_player)
     .setLargeIcon(albumArtBitmap))
     .setCustomContentView(contentView)
     .setStyle(new NotificationCompat.DecoratedCustomViewStyle())
     .build();
 

If you are using this style, consider using the corresponding styles like R.style.TextAppearance_Compat_Notification or R.style.TextAppearance_Compat_Notification_Title in your custom views in order to get the correct styling on each platform version.

Summary

Public constructors

NotificationCompat.DecoratedCustomViewStyle()

Inherited methods

Public constructors

NotificationCompat.DecoratedCustomViewStyle

added in version 1.0.0
public NotificationCompat.DecoratedCustomViewStyle ()