NotificationCompat.BigPictureStyle
class NotificationCompat.BigPictureStyle : NotificationCompat.Style
| kotlin.Any | ||
| ↳ | 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 |
|---|
BigPictureStyle(builder: NotificationCompat.Builder?) |
Public functions |
|
|---|---|
NotificationCompat.BigPictureStyle |
bigLargeIcon(b: Bitmap?)Override the large icon when the big notification is shown. |
NotificationCompat.BigPictureStyle |
@RequiresApi(value = 23)Override the large icon when the big notification is shown. |
NotificationCompat.BigPictureStyle |
bigPicture(b: Bitmap?)Provide the bitmap to be used as the payload for the BigPicture notification. |
NotificationCompat.BigPictureStyle |
@RequiresApi(value = 31)Provide an icon to be used as the payload for the BigPicture notification. |
NotificationCompat.BigPictureStyle |
setBigContentTitle(title: CharSequence?)Overrides ContentTitle in the big form of the template. |
NotificationCompat.BigPictureStyle |
@RequiresApi(value = 31)Set the content description of the big picture. |
NotificationCompat.BigPictureStyle |
setSummaryText(cs: CharSequence?)Set the first line of text after the detail section in the big form of the template. |
NotificationCompat.BigPictureStyle |
@RequiresApi(value = 31)When set, the |
Inherited functions |
||||
|---|---|---|---|---|
|
Public constructors
Public functions
bigLargeIcon
fun bigLargeIcon(b: Bitmap?): NotificationCompat.BigPictureStyle
Override the large icon when the big notification is shown.
bigLargeIcon
@RequiresApi(value = 23)
fun bigLargeIcon(i: Icon?): NotificationCompat.BigPictureStyle
Override the large icon when the big notification is shown.
bigPicture
fun bigPicture(b: Bitmap?): NotificationCompat.BigPictureStyle
Provide the bitmap to be used as the payload for the BigPicture notification.
bigPicture
@RequiresApi(value = 31)
fun bigPicture(i: Icon?): NotificationCompat.BigPictureStyle
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
fun setBigContentTitle(title: CharSequence?): NotificationCompat.BigPictureStyle
Overrides ContentTitle in the big form of the template. This defaults to the value passed to setContentTitle().
setContentDescription
@RequiresApi(value = 31)
fun setContentDescription(contentDescription: CharSequence?): NotificationCompat.BigPictureStyle
Set the content description of the big picture.
setSummaryText
fun setSummaryText(cs: CharSequence?): NotificationCompat.BigPictureStyle
Set the first line of text after the detail section in the big form of the template.
showBigPictureWhenCollapsed
@RequiresApi(value = 31)
fun showBigPictureWhenCollapsed(show: Boolean): NotificationCompat.BigPictureStyle
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.