3 Answers
Sizes for notification images for BigPictureStyle
Minimum - 512x256
Balanced - 1024x512
Maximum - 2048x1024
Got from this answer https://stackoverflow.com/a/33391039/5783417
Note : In smaller devices (800x480), there is still a center crop occurring

- 1
- 1

- 463
- 3
- 22
-
Is there any source for the 2:1 ratios and 800x480? – conca Dec 12 '18 at 01:41
Try this code
Notification notif = 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();

- 3,185
- 1
- 22
- 42
To have a notification appear in an expanded view, first create a NotificationCompat.Builder object with the normal view options you want. Next, call Builder.setStyle() with an expanded layout object as its argument.
Remember that expanded notifications are not available on platforms prior to Android 4.1. To learn how to handle notifications for Android 4.1 and for earlier platforms, read the section Handling compatibility.
For example, the following code snippet demonstrates how to alter the notification created in the previous snippet to use the expanded layout:
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.notification_icon)
.setContentTitle("Event tracker")
.setContentText("Events received")
NotificationCompat.InboxStyle inboxStyle =
new NotificationCompat.InboxStyle();
String[] events = new String[6];
// Sets a title for the Inbox in expanded layout
inboxStyle.setBigContentTitle("Event tracker details:");
...
// Moves events into the expanded layout
for (int i=0; i < events.length; i++) {
inboxStyle.addLine(events[i]);
}
// Moves the expanded layout object into the notification object.
mBuilder.setStyle(inboxStyle);
...
// Issue the notification here.
You can also refer to this link, Applying an expanded layout to a notification

- 2,115
- 2
- 18
- 29