Browse Source

Destroy action mode after actioning in chapters list (closes #3004)

arkon 4 years ago
parent
commit
03baa21185

+ 7 - 0
app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt

@@ -485,10 +485,12 @@ class ChaptersController :
         if (presenter.preferences.removeAfterMarkedAsRead()) {
             deleteChapters(chapters)
         }
+        destroyActionModeIfNeeded()
     }
 
     private fun markAsUnread(chapters: List<ChapterItem>) {
         presenter.markChaptersRead(chapters, false)
+        destroyActionModeIfNeeded()
     }
 
     private fun downloadChapters(chapters: List<ChapterItem>) {
@@ -501,6 +503,7 @@ class ChaptersController :
                 }
             }
         }
+        destroyActionModeIfNeeded()
     }
 
     private fun showDeleteChaptersConfirmationDialog() {
@@ -518,16 +521,19 @@ class ChaptersController :
         if (chapterPos != -1) {
             markAsRead(prevChapters.take(chapterPos))
         }
+        destroyActionModeIfNeeded()
     }
 
     private fun bookmarkChapters(chapters: List<ChapterItem>, bookmarked: Boolean) {
         presenter.bookmarkChapters(chapters, bookmarked)
+        destroyActionModeIfNeeded()
     }
 
     fun deleteChapters(chapters: List<ChapterItem>) {
         if (chapters.isEmpty()) return
 
         presenter.deleteChapters(chapters)
+        destroyActionModeIfNeeded()
     }
 
     fun onChaptersDeleted(chapters: List<ChapterItem>) {
@@ -570,6 +576,7 @@ class ChaptersController :
         if (chaptersToDownload.isNotEmpty()) {
             downloadChapters(chaptersToDownload)
         }
+        destroyActionModeIfNeeded()
     }
 
     private fun showCustomDownloadDialog() {