private static void fixNotificationIcon(Context context, Notification notification, Notification.Builder builder) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { //noinspection deprecation builder.setSmallIcon(notification.icon); //noinspection deprecation builder.setLargeIcon(notification.largeIcon); } else { Icon icon = notification.getSmallIcon(); if (icon != null) { Bitmap bitmap = drawableToBitMap(icon.loadDrawable(context)); if (bitmap != null) { Icon newIcon = Icon.createWithBitmap(bitmap); builder.setSmallIcon(newIcon); } } Icon largeIcon = notification.getLargeIcon(); if (largeIcon != null) { Bitmap bitmap = drawableToBitMap(largeIcon.loadDrawable(context)); if (bitmap != null) { Icon newIcon = Icon.createWithBitmap(bitmap); builder.setLargeIcon(newIcon); } } } }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { getNotificationFixer().fixIcon(notification.getSmallIcon(), appContext, packageInfo != null); getNotificationFixer().fixIcon(notification.getLargeIcon(), appContext, packageInfo != null); } else { getNotificationFixer().fixIconImage(appContext.getResources(), notification.contentView, false, notification);
Icon icon = validSbn.getNotification().getLargeIcon();
unloadedLargeIcon = notification.getLargeIcon();
private static void fixNotificationIcon(Context context, Notification notification, Notification.Builder builder) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { //noinspection deprecation builder.setSmallIcon(notification.icon); //noinspection deprecation builder.setLargeIcon(notification.largeIcon); } else { Icon icon = notification.getSmallIcon(); if (icon != null) { Bitmap bitmap = drawableToBitMap(icon.loadDrawable(context)); if (bitmap != null) { Icon newIcon = Icon.createWithBitmap(bitmap); builder.setSmallIcon(newIcon); } } Icon largeIcon = notification.getLargeIcon(); if (largeIcon != null) { Bitmap bitmap = drawableToBitMap(largeIcon.loadDrawable(context)); if (bitmap != null) { Icon newIcon = Icon.createWithBitmap(bitmap); builder.setLargeIcon(newIcon); } } } }
private static void fixNotificationIcon(Context context, Notification notification, Notification.Builder builder) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { //noinspection deprecation builder.setSmallIcon(notification.icon); //noinspection deprecation builder.setLargeIcon(notification.largeIcon); } else { Icon icon = notification.getSmallIcon(); if (icon != null) { Bitmap bitmap = drawableToBitMap(icon.loadDrawable(context)); if (bitmap != null) { Icon newIcon = Icon.createWithBitmap(bitmap); builder.setSmallIcon(newIcon); } } Icon largeIcon = notification.getLargeIcon(); if (largeIcon != null) { Bitmap bitmap = drawableToBitMap(largeIcon.loadDrawable(context)); if (bitmap != null) { Icon newIcon = Icon.createWithBitmap(bitmap); builder.setLargeIcon(newIcon); } } } }
AndroidVersion.isAtLeastMarshmallow ? 2 : 1; // We need some kind of compat for this if (mBadgeIcon != 1 && AndroidVersion.isAtLeastMarshmallow) { icon = notification.getLargeIcon();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { getNotificationFixer().fixIcon(notification.getSmallIcon(), appContext, packageInfo != null); getNotificationFixer().fixIcon(notification.getLargeIcon(), appContext, packageInfo != null); } else { getNotificationFixer().fixIconImage(appContext.getResources(), notification.contentView, false, notification);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { getNotificationFixer().fixIcon(notification.getSmallIcon(), appContext, packageInfo != null); getNotificationFixer().fixIcon(notification.getLargeIcon(), appContext, packageInfo != null); } else { getNotificationFixer().fixIconImage(appContext.getResources(), notification.contentView, false, notification);
Context foreignContext = context.createPackageContext(statusBarNotification.getPackageName(), 0); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) { appIcon = iconToBitmap(foreignContext, notification.getLargeIcon()); } else { appIcon = notification.largeIcon;