From c189a840a7c588c4fa509ecd449479bc66537191 Mon Sep 17 00:00:00 2001 From: Jay Date: Mon, 1 Jun 2020 20:32:51 -0400 Subject: [PATCH] Moved reader dismiss notification to the presenter --- .../java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt | 7 +------ .../java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt | 6 ++++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index 032a35735d..8a78c74cfa 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -31,8 +31,6 @@ import com.google.android.material.snackbar.Snackbar import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.database.models.Chapter import eu.kanade.tachiyomi.data.database.models.Manga -import eu.kanade.tachiyomi.data.notification.NotificationReceiver -import eu.kanade.tachiyomi.data.notification.Notifications import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.ui.base.MaterialMenuSheet @@ -161,8 +159,7 @@ class ReaderActivity : BaseRxActivity(), const val WEBTOON = 4 const val VERTICAL_PLUS = 5 - fun newIntent(context: Context, manga: Manga, chapter: Chapter): - Intent { + fun newIntent(context: Context, manga: Manga, chapter: Chapter): Intent { val intent = Intent(context, ReaderActivity::class.java) intent.putExtra("manga", manga.id) intent.putExtra("chapter", chapter.id) @@ -200,8 +197,6 @@ class ReaderActivity : BaseRxActivity(), finish() return } - NotificationReceiver.dismissNotification(this, manga.hashCode(), Notifications.ID_NEW_CHAPTERS) - presenter.init(manga, chapter) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt index e4fddea339..7e6a94f494 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt @@ -11,6 +11,8 @@ import eu.kanade.tachiyomi.data.database.models.Chapter import eu.kanade.tachiyomi.data.database.models.History import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.download.DownloadManager +import eu.kanade.tachiyomi.data.notification.NotificationReceiver +import eu.kanade.tachiyomi.data.notification.Notifications import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.data.track.TrackManager @@ -231,6 +233,10 @@ class ReaderPresenter( this.manga = manga if (chapterId == -1L) chapterId = initialChapterId + NotificationReceiver.dismissNotification( + preferences.context, manga.id!!.hashCode(), Notifications.ID_NEW_CHAPTERS + ) + val source = sourceManager.getOrStub(manga.source) loader = ChapterLoader(downloadManager, manga, source)