public class

NotificationCompat.InboxStyle

extends NotificationCompat.Style

 java.lang.Object

androidx.core.app.NotificationCompat.Style

↳androidx.core.app.NotificationCompat.InboxStyle

Overview

Helper class for generating large-format notifications that include a list of (up to 5) strings.
If the platform does not provide large-format notifications, this method has no effect. The user will always see the normal notification view.
This class is a "rebuilder": It attaches to a Builder object and modifies its behavior, like so:

 Notification notification = new Notification.Builder()
     .setContentTitle("5 New mails from " + sender.toString())
     .setContentText(subject)
     .setSmallIcon(R.drawable.new_mail)
     .setLargeIcon(aBitmap)
     .setStyle(new Notification.InboxStyle()
         .addLine(str1)
         .addLine(str2)
         .setContentTitle("")
         .setSummaryText("+3 more"))
     .build();
 

Summary

Fields
from NotificationCompat.StylemBuilder
Constructors
publicInboxStyle()

publicInboxStyle(NotificationCompat.Builder builder)

Methods
public NotificationCompat.InboxStyleaddLine(java.lang.CharSequence cs)

Append a line to the digest section of the Inbox notification.

public voidapply(NotificationBuilderWithBuilderAccessor builder)

Applies the compat style data to the framework Notification in a backwards compatible way.

protected voidclearCompatExtraKeys(Bundle extras)

protected java.lang.StringgetClassName()

protected voidrestoreFromCompatExtras(Bundle extras)

public NotificationCompat.InboxStylesetBigContentTitle(java.lang.CharSequence title)

Overrides ContentTitle in the big form of the template.

public NotificationCompat.InboxStylesetSummaryText(java.lang.CharSequence cs)

Set the first line of text after the detail section in the big form of the template.

from NotificationCompat.StyleaddCompatExtras, applyStandardTemplate, build, buildIntoRemoteViews, createColoredBitmap, displayCustomViewInline, extractStyleFromNotification, makeBigContentView, makeContentView, makeHeadsUpContentView, setBuilder
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public InboxStyle()

public InboxStyle(NotificationCompat.Builder builder)

Methods

public NotificationCompat.InboxStyle setBigContentTitle(java.lang.CharSequence title)

Overrides ContentTitle in the big form of the template. This defaults to the value passed to setContentTitle().

public NotificationCompat.InboxStyle setSummaryText(java.lang.CharSequence cs)

Set the first line of text after the detail section in the big form of the template.

public NotificationCompat.InboxStyle addLine(java.lang.CharSequence cs)

Append a line to the digest section of the Inbox notification.

protected java.lang.String getClassName()

public void apply(NotificationBuilderWithBuilderAccessor builder)

Applies the compat style data to the framework Notification in a backwards compatible way. All other data should be stored within the Notification's extras.

protected void restoreFromCompatExtras(Bundle extras)

protected void clearCompatExtraKeys(Bundle extras)