public class

NotificationCompat.BigTextStyle

extends NotificationCompat.Style

 java.lang.Object

androidx.core.app.NotificationCompat.Style

↳androidx.core.app.NotificationCompat.BigTextStyle

Overview

Helper class for generating large-format notifications that include a lot of text.
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(mContext)
     .setContentTitle("New mail from " + sender.toString())
     .setContentText(subject)
     .setSmallIcon(R.drawable.new_mail)
     .setLargeIcon(aBitmap)
     .setStyle(new Notification.BigTextStyle()
         .bigText(aVeryLongString))
     .build();
 

Summary

Fields
from NotificationCompat.StylemBuilder
Constructors
publicBigTextStyle()

publicBigTextStyle(NotificationCompat.Builder builder)

Methods
public voidaddCompatExtras(Bundle extras)

This is called with the extras of the framework Notification during the NotificationCompat.Builder.build() process, after apply() has been called.

public voidapply(NotificationBuilderWithBuilderAccessor builder)

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

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

Provide the longer text to be displayed in the big form of the template in place of the content text.

protected voidclearCompatExtraKeys(Bundle extras)

protected java.lang.StringgetClassName()

protected voidrestoreFromCompatExtras(Bundle extras)

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

Overrides ContentTitle in the big form of the template.

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

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

from NotificationCompat.StyleapplyStandardTemplate, 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 BigTextStyle()

public BigTextStyle(NotificationCompat.Builder builder)

Methods

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

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

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

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

public NotificationCompat.BigTextStyle bigText(java.lang.CharSequence cs)

Provide the longer text to be displayed in the big form of the template in place of the content text.

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)

public void addCompatExtras(Bundle extras)

This is called with the extras of the framework Notification during the NotificationCompat.Builder.build() process, after apply() has been called. This means that you only need to add data which won't be populated by the framework Notification which was built so far. Moreover, recovering builders and styles is only supported at API 19 and above, no implementation is required for current BigTextStyle, BigPictureStyle, or InboxStyle.

protected void clearCompatExtraKeys(Bundle extras)