From 07cb1c237edfb6471a1d295daf3c731299567945 Mon Sep 17 00:00:00 2001 From: arkon Date: Tue, 13 Apr 2021 08:51:55 -0400 Subject: [PATCH] Allow dismissing download progress notification when paused (closes #4832) --- .../eu/kanade/tachiyomi/data/download/DownloadNotifier.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadNotifier.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadNotifier.kt index f7a43362dc..8caa67bced 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadNotifier.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadNotifier.kt @@ -28,7 +28,6 @@ internal class DownloadNotifier(private val context: Context) { context.notificationBuilder(Notifications.CHANNEL_DOWNLOADER_PROGRESS) { setLargeIcon(BitmapFactory.decodeResource(context.resources, R.mipmap.ic_launcher)) setAutoCancel(false) - setOngoing(true) setOnlyAlertOnce(true) } } @@ -84,7 +83,6 @@ internal class DownloadNotifier(private val context: Context) { */ fun onProgressChange(download: Download) { with(progressNotificationBuilder) { - // Check if first call. if (!isDownloading) { setSmallIcon(android.R.drawable.stat_sys_download) clearActions() @@ -116,6 +114,7 @@ internal class DownloadNotifier(private val context: Context) { } setProgress(download.pages!!.size, download.downloadedImages, false) + setOngoing(true) show(Notifications.ID_DOWNLOAD_CHAPTER_PROGRESS) } @@ -130,6 +129,7 @@ internal class DownloadNotifier(private val context: Context) { setContentText(context.getString(R.string.download_notifier_download_paused)) setSmallIcon(R.drawable.ic_pause_24dp) setProgress(0, 0, false) + setOngoing(false) clearActions() // Open download manager when clicked setContentIntent(NotificationHandler.openDownloadManagerPendingActivity(context))