add different icons for notification

pull/839/head
deniscerri 1 year ago
parent 4284d6c5fe
commit 6e1675fa7b
No known key found for this signature in database
GPG Key ID: 95C43D517D830350

@ -111,11 +111,11 @@ class NotificationUtil(var context: Context) {
return notificationBuilder return notificationBuilder
.setContentTitle(resources.getString(R.string.downloading)) .setContentTitle(resources.getString(R.string.downloading))
.setOngoing(true) .setOngoing(true)
.setSmallIcon(R.drawable.ic_launcher_foreground_large) .setSmallIcon(android.R.drawable.stat_sys_download)
.setLargeIcon( .setLargeIcon(
BitmapFactory.decodeResource( BitmapFactory.decodeResource(
resources, resources,
R.drawable.ic_launcher_foreground_large android.R.drawable.stat_sys_download
) )
) )
.setPriority(NotificationCompat.PRIORITY_LOW) .setPriority(NotificationCompat.PRIORITY_LOW)
@ -384,11 +384,11 @@ class NotificationUtil(var context: Context) {
notificationBuilder notificationBuilder
.setContentTitle("${res.getString(R.string.failed_download)}: $title") .setContentTitle("${res.getString(R.string.failed_download)}: $title")
.setContentText(error) .setContentText(error)
.setSmallIcon(R.drawable.ic_launcher_foreground_large) .setSmallIcon(R.drawable.baseline_error_24)
.setLargeIcon( .setLargeIcon(
BitmapFactory.decodeResource( BitmapFactory.decodeResource(
res, res,
R.drawable.ic_launcher_foreground_large R.drawable.baseline_error_24
) )
) )
.setGroup(DOWNLOAD_ERRORED_NOTIFICATION_ID.toString()) .setGroup(DOWNLOAD_ERRORED_NOTIFICATION_ID.toString())
@ -410,10 +410,10 @@ class NotificationUtil(var context: Context) {
) { ) {
//make summary notification //make summary notification
val summaryNotification = getBuilder(DOWNLOAD_WORKER_CHANNEL_ID) val summaryNotification = getBuilder(DOWNLOAD_WORKER_CHANNEL_ID)
.setSmallIcon(R.drawable.ic_launcher_foreground_large) .setSmallIcon(R.drawable.baseline_error_24)
.setLargeIcon(BitmapFactory.decodeResource( .setLargeIcon(BitmapFactory.decodeResource(
res, res,
R.drawable.ic_launcher_foreground_large R.drawable.baseline_error_24
)) ))
.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN) .setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN)
.setGroup(DOWNLOAD_ERRORED_NOTIFICATION_ID.toString()) .setGroup(DOWNLOAD_ERRORED_NOTIFICATION_ID.toString())

@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="@color/icon_fg" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-2h2v2zM13,13h-2L11,7h2v6z"/>
</vector>
Loading…
Cancel
Save