public class

NotificationCompat.BigPictureStyle

extends NotificationCompat.Style

 java.lang.Object

androidx.core.app.NotificationCompat.Style

↳androidx.core.app.NotificationCompat.BigPictureStyle

Overview

Helper class for generating large-format notifications that include a large image attachment.
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 photo from " + sender.toString())
     .setContentText(subject)
     .setSmallIcon(R.drawable.new_post)
     .setLargeIcon(aBitmap)
     .setStyle(new Notification.BigPictureStyle()
         .bigPicture(aBigBitmap))
     .build();
 

Summary

Fields
from NotificationCompat.StylemBuilder
Constructors
publicBigPictureStyle()

publicBigPictureStyle(NotificationCompat.Builder builder)

Methods
public voidapply(NotificationBuilderWithBuilderAccessor builder)

public NotificationCompat.BigPictureStylebigLargeIcon(Bitmap b)

Override the large icon when the big notification is shown.

public NotificationCompat.BigPictureStylebigPicture(Bitmap b)

Provide the bitmap to be used as the payload for the BigPicture notification.

protected voidclearCompatExtraKeys(Bundle extras)

protected java.lang.StringgetClassName()

protected voidrestoreFromCompatExtras(Bundle extras)

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

Overrides ContentTitle in the big form of the template.

public NotificationCompat.BigPictureStylesetContentDescription(java.lang.CharSequence contentDescription)

Set the content description of the big picture.

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

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

public NotificationCompat.BigPictureStyleshowBigPictureWhenCollapsed(boolean show)

When set, the big picture of this style will be promoted and shown in place of the large icon in the collapsed state of this notification.

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 BigPictureStyle()

public BigPictureStyle(NotificationCompat.Builder builder)

Methods

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

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

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

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

public NotificationCompat.BigPictureStyle setContentDescription(java.lang.CharSequence contentDescription)

Set the content description of the big picture.

public NotificationCompat.BigPictureStyle bigPicture(Bitmap b)

Provide the bitmap to be used as the payload for the BigPicture notification.

public NotificationCompat.BigPictureStyle showBigPictureWhenCollapsed(boolean show)

When set, the big picture of this style will be promoted and shown in place of the large icon in the collapsed state of this notification.

public NotificationCompat.BigPictureStyle bigLargeIcon(Bitmap b)

Override the large icon when the big notification is shown.

protected java.lang.String getClassName()

public void apply(NotificationBuilderWithBuilderAccessor builder)

protected void restoreFromCompatExtras(Bundle extras)

protected void clearCompatExtraKeys(Bundle extras)