mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 19:27:25 +01:00
Library notification: handle only one update as a special case
This commit is contained in:
parent
f9fec74ffd
commit
3094d084d6
@ -397,15 +397,17 @@ class LibraryUpdateService(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val title = getString(R.string.notification_new_chapters)
|
|
||||||
val text = getString(R.string.notification_new_chapters_text, newUpdates.size)
|
|
||||||
|
|
||||||
notificationManager.notify(Constants.NOTIFICATION_LIBRARY_RESULT_ID, notification {
|
notificationManager.notify(Constants.NOTIFICATION_LIBRARY_RESULT_ID, notification {
|
||||||
setSmallIcon(R.drawable.ic_book_white_24dp)
|
setSmallIcon(R.drawable.ic_book_white_24dp)
|
||||||
setLargeIcon(notificationBitmap)
|
setLargeIcon(notificationBitmap)
|
||||||
setContentTitle(title)
|
setContentTitle(getString(R.string.notification_new_chapters))
|
||||||
setContentText(text)
|
if (newUpdates.size > 1) {
|
||||||
setStyle(NotificationCompat.BigTextStyle().bigText(newUpdates.joinToString("\n")))
|
setContentText(getString(R.string.notification_new_chapters_text, newUpdates.size))
|
||||||
|
setStyle(NotificationCompat.BigTextStyle().bigText(newUpdates.joinToString("\n")))
|
||||||
|
} else {
|
||||||
|
setContentText(newUpdates.first())
|
||||||
|
}
|
||||||
|
priority = NotificationCompat.PRIORITY_HIGH
|
||||||
setContentIntent(getNotificationIntent())
|
setContentIntent(getNotificationIntent())
|
||||||
setAutoCancel(true)
|
setAutoCancel(true)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user