I had been already working on app with avalanche message notifications and I'd faced a problem with notification large icon size on older than Lollipop Android version driven devices.
On Lollipop and Marshmallow devices it looks fine:

but when I had opened an app on my Android 4.4 emulator, I found this:

The image wasn't scaled, fitted, just cropped in the middle. It definitely looked not good.
NOTE: To make it clear, that this large notification icons is downloaded from server together with message date and content. It looks like this:
After some hours of work in my avalanche notification class I added two methods, which run only if Android pre-lollipop version is detected:
After changes, my notification icon on the same Kitkat emulator (Moto X 2013) looks much better:

Could you tell me if there is a much simpler way to deal with this problem? If not, which icon sizes I need to support, besides 96x96?
Thanks in advance
If i understood correctly, you want to have the notification icon to look good both on lollipop devices and pre lollipop, in my experience what i did to ensure a good look in both SDK's was this:
For the notification large icon i use resources with these size's : 96x96 (hdpi) 64x64 (mdpi) 128x128 (xhdpi) 192x192 (xxhdpi) 256x256 (xxxhdpi)
I use this code to configure the notification style:
NotificationCompat.BigTextStyle notiStyle = new NotificationCompat.BigTextStyle();
notiStyle.setBigContentTitle(title);
notiStyle.bigText(msg);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context)
.setContentTitle(title)
.setContentText(msg)
.setColor(coloresOnboarding.getColor())
.setCategory(NotificationCompat.CATEGORY_MESSAGE)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setVibrate(new long[]{1000, 1000, 1000, 1000, 1000})
.setSmallIcon(R.mipmap.ic_launchersmall)
.setAutoCancel(true)
.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_launcherlarge))
.setStyle(notiStyle);
Intent resultIntent = new Intent(context, HeadAppMain.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.setContentIntent(pendingIntent);
NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
int mId=1;
mBuilder.setAutoCancel(true);
i hope this help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With