add different icons for notification
This commit is contained in:
parent
4284d6c5fe
commit
6e1675fa7b
2 changed files with 11 additions and 6 deletions
|
|
@ -111,11 +111,11 @@ class NotificationUtil(var context: Context) {
|
|||
return notificationBuilder
|
||||
.setContentTitle(resources.getString(R.string.downloading))
|
||||
.setOngoing(true)
|
||||
.setSmallIcon(R.drawable.ic_launcher_foreground_large)
|
||||
.setSmallIcon(android.R.drawable.stat_sys_download)
|
||||
.setLargeIcon(
|
||||
BitmapFactory.decodeResource(
|
||||
resources,
|
||||
R.drawable.ic_launcher_foreground_large
|
||||
android.R.drawable.stat_sys_download
|
||||
)
|
||||
)
|
||||
.setPriority(NotificationCompat.PRIORITY_LOW)
|
||||
|
|
@ -384,11 +384,11 @@ class NotificationUtil(var context: Context) {
|
|||
notificationBuilder
|
||||
.setContentTitle("${res.getString(R.string.failed_download)}: $title")
|
||||
.setContentText(error)
|
||||
.setSmallIcon(R.drawable.ic_launcher_foreground_large)
|
||||
.setSmallIcon(R.drawable.baseline_error_24)
|
||||
.setLargeIcon(
|
||||
BitmapFactory.decodeResource(
|
||||
res,
|
||||
R.drawable.ic_launcher_foreground_large
|
||||
R.drawable.baseline_error_24
|
||||
)
|
||||
)
|
||||
.setGroup(DOWNLOAD_ERRORED_NOTIFICATION_ID.toString())
|
||||
|
|
@ -410,10 +410,10 @@ class NotificationUtil(var context: Context) {
|
|||
) {
|
||||
//make summary notification
|
||||
val summaryNotification = getBuilder(DOWNLOAD_WORKER_CHANNEL_ID)
|
||||
.setSmallIcon(R.drawable.ic_launcher_foreground_large)
|
||||
.setSmallIcon(R.drawable.baseline_error_24)
|
||||
.setLargeIcon(BitmapFactory.decodeResource(
|
||||
res,
|
||||
R.drawable.ic_launcher_foreground_large
|
||||
R.drawable.baseline_error_24
|
||||
))
|
||||
.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN)
|
||||
.setGroup(DOWNLOAD_ERRORED_NOTIFICATION_ID.toString())
|
||||
|
|
|
|||
5
app/src/main/res/drawable/baseline_error_24.xml
Normal file
5
app/src/main/res/drawable/baseline_error_24.xml
Normal file
|
|
@ -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…
Reference in a new issue