NotificationCompat.BigPictureStyle

Added in 1.1.0

public class NotificationCompat.BigPictureStyle extends NotificationCompat.Style


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();
See also
bigContentView

Summary

Public methods

@NonNull NotificationCompat.BigPictureStyle

Override the large icon when the big notification is shown.

@NonNull NotificationCompat.BigPictureStyle

Override the large icon when the big notification is shown.

@NonNull NotificationCompat.BigPictureStyle

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

@NonNull NotificationCompat.BigPictureStyle
@RequiresApi(value = 31)
bigPicture(@Nullable Icon i)

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

@NonNull NotificationCompat.BigPictureStyle

Overrides ContentTitle in the big form of the template.

@NonNull NotificationCompat.BigPictureStyle
@RequiresApi(value = 31)
setContentDescription(@Nullable CharSequence contentDescription)

Set the content description of the big picture.

@NonNull NotificationCompat.BigPictureStyle

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

@NonNull NotificationCompat.BigPictureStyle
@RequiresApi(value = 31)
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.

Inherited methods

From androidx.core.app.NotificationCompat.Style
@Nullable Notification

If this Style object has been set on a notification builder, this method will build that notification and return it.

void

Link this rich notification style with a notification builder.

Public constructors

BigPictureStyle

Added in 1.1.0
public BigPictureStyle()

BigPictureStyle

Added in 1.1.0
public BigPictureStyle(@Nullable NotificationCompat.Builder builder)

Public methods

bigLargeIcon

Added in 1.1.0
public @NonNull NotificationCompat.BigPictureStyle bigLargeIcon(@Nullable Bitmap b)

Override the large icon when the big notification is shown.

bigLargeIcon

Added in 1.10.0
@RequiresApi(value = 23)
public @NonNull NotificationCompat.BigPictureStyle bigLargeIcon(@Nullable Icon i)

Override the large icon when the big notification is shown.

bigPicture

Added in 1.1.0
public @NonNull NotificationCompat.BigPictureStyle bigPicture(@Nullable Bitmap b)

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

bigPicture

Added in 1.9.0
@RequiresApi(value = 31)
public @NonNull NotificationCompat.BigPictureStyle bigPicture(@Nullable 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.

setBigContentTitle

Added in 1.1.0
public @NonNull NotificationCompat.BigPictureStyle setBigContentTitle(@Nullable CharSequence title)

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

setContentDescription

Added in 1.8.0
@RequiresApi(value = 31)
public @NonNull NotificationCompat.BigPictureStyle setContentDescription(@Nullable CharSequence contentDescription)

Set the content description of the big picture.

setSummaryText

Added in 1.1.0
public @NonNull NotificationCompat.BigPictureStyle setSummaryText(@Nullable CharSequence cs)

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

showBigPictureWhenCollapsed

Added in 1.7.0
@RequiresApi(value = 31)
public @NonNull 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.