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)

public voidapply(NotificationBuilderWithBuilderAccessor builder)

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)

protected void restoreFromCompatExtras(Bundle extras)

public void addCompatExtras(Bundle extras)

protected void clearCompatExtraKeys(Bundle extras)