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 NotificationCompat.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)

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

public NotificationCompat.BigPictureStylebigLargeIcon(Bitmap b)

Override the large icon when the big notification is shown.

public NotificationCompat.BigPictureStylebigLargeIcon(Icon i)

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.

public NotificationCompat.BigPictureStylebigPicture(Icon i)

Provide an icon to be used as the payload for the BigPicture notification.

protected voidclearCompatExtraKeys(Bundle extras)

protected java.lang.StringgetClassName()

public static IconCompatgetPictureIcon(Bundle extras)

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 bigPicture(Icon i)

Provide an icon to be used as the payload for the BigPicture notification. Note that certain features (like animated Icons) may not work on all versions.

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.

public NotificationCompat.BigPictureStyle bigLargeIcon(Icon i)

Override the large icon when the big notification is shown.

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 static IconCompat getPictureIcon(Bundle extras)

protected void clearCompatExtraKeys(Bundle extras)