NotificationCompat.BigPictureStyle
public class NotificationCompat.BigPictureStyle extends NotificationCompat.Style
| java.lang.Object | ||
| ↳ | androidx.core.app.NotificationCompat.Style | |
| ↳ | androidx.core.app.NotificationCompat.BigPictureStyle |
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 constructors |
|---|
Public methods |
|
|---|---|
@NonNull NotificationCompat.BigPictureStyle |
Override the large icon when the big notification is shown. |
@NonNull NotificationCompat.BigPictureStyle |
@RequiresApi(value = 23)Override the large icon when the big notification is shown. |
@NonNull NotificationCompat.BigPictureStyle |
bigPicture(@Nullable Bitmap b)Provide the bitmap to be used as the payload for the BigPicture notification. |
@NonNull NotificationCompat.BigPictureStyle |
@RequiresApi(value = 31)Provide an icon to be used as the payload for the BigPicture notification. |
@NonNull NotificationCompat.BigPictureStyle |
setBigContentTitle(@Nullable CharSequence title)Overrides ContentTitle in the big form of the template. |
@NonNull NotificationCompat.BigPictureStyle |
@RequiresApi(value = 31)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)When set, the |
Inherited methods |
||||
|---|---|---|---|---|
|
Public constructors
Public methods
bigLargeIcon
public @NonNull NotificationCompat.BigPictureStyle bigLargeIcon(@Nullable Bitmap b)
Override the large icon when the big notification is shown.
bigLargeIcon
@RequiresApi(value = 23)
public @NonNull NotificationCompat.BigPictureStyle bigLargeIcon(@Nullable Icon i)
Override the large icon when the big notification is shown.
bigPicture
public @NonNull NotificationCompat.BigPictureStyle bigPicture(@Nullable Bitmap b)
Provide the bitmap to be used as the payload for the BigPicture notification.
bigPicture
@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
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
@RequiresApi(value = 31)
public @NonNull NotificationCompat.BigPictureStyle setContentDescription(@Nullable CharSequence contentDescription)
Set the content description of the big picture.
setSummaryText
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
@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.