public class

NotificationCompat.DecoratedCustomViewStyle

extends NotificationCompat.Style

 java.lang.Object

androidx.core.app.NotificationCompat.Style

↳androidx.core.app.NotificationCompat.DecoratedCustomViewStyle

Overview

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 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 or in your custom views in order to get the correct styling on each platform version.

Summary

Fields
from NotificationCompat.StylemBuilder
Constructors
publicDecoratedCustomViewStyle()

Methods
public voidapply(NotificationBuilderWithBuilderAccessor builder)

public booleandisplayCustomViewInline()

protected java.lang.StringgetClassName()

public RemoteViewsmakeBigContentView(NotificationBuilderWithBuilderAccessor builder)

public RemoteViewsmakeContentView(NotificationBuilderWithBuilderAccessor builder)

public RemoteViewsmakeHeadsUpContentView(NotificationBuilderWithBuilderAccessor builder)

from NotificationCompat.StyleaddCompatExtras, applyStandardTemplate, build, buildIntoRemoteViews, clearCompatExtraKeys, createColoredBitmap, extractStyleFromNotification, restoreFromCompatExtras, setBuilder
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public DecoratedCustomViewStyle()

Methods

protected java.lang.String getClassName()

public boolean displayCustomViewInline()

public void apply(NotificationBuilderWithBuilderAccessor builder)

public RemoteViews makeContentView(NotificationBuilderWithBuilderAccessor builder)

public RemoteViews makeBigContentView(NotificationBuilderWithBuilderAccessor builder)

public RemoteViews makeHeadsUpContentView(NotificationBuilderWithBuilderAccessor builder)