mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-16 14:07:28 +01:00
Refactor notification builder extension
This commit is contained in:
@@ -9,6 +9,7 @@ import eu.kanade.tachiyomi.data.glide.GlideApp
|
||||
import eu.kanade.tachiyomi.data.notification.NotificationHandler
|
||||
import eu.kanade.tachiyomi.data.notification.NotificationReceiver
|
||||
import eu.kanade.tachiyomi.data.notification.Notifications
|
||||
import eu.kanade.tachiyomi.util.system.notificationBuilder
|
||||
import eu.kanade.tachiyomi.util.system.notificationManager
|
||||
import java.io.File
|
||||
|
||||
@@ -20,7 +21,7 @@ class SaveImageNotifier(private val context: Context) {
|
||||
/**
|
||||
* Notification builder.
|
||||
*/
|
||||
private val notificationBuilder = NotificationCompat.Builder(context, Notifications.CHANNEL_COMMON)
|
||||
private val notificationBuilder = context.notificationBuilder(Notifications.CHANNEL_COMMON)
|
||||
|
||||
/**
|
||||
* Id of the notification.
|
||||
@@ -59,8 +60,9 @@ class SaveImageNotifier(private val context: Context) {
|
||||
setAutoCancel(true)
|
||||
|
||||
// Clear old actions if they exist
|
||||
if (mActions.isNotEmpty())
|
||||
if (mActions.isNotEmpty()) {
|
||||
mActions.clear()
|
||||
}
|
||||
|
||||
setContentIntent(NotificationHandler.openImagePendingActivity(context, file))
|
||||
// Share action
|
||||
|
||||
Reference in New Issue
Block a user