From 33d2b0984feb5dec8cea9b172b25bab00bd1a411 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 1 May 2020 19:49:33 -0400 Subject: [PATCH] Fix chapter list selection uninverting (closes #3014) --- .../kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt | 5 +++++ .../kanade/tachiyomi/ui/recent/updates/UpdatesController.kt | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt index 8a8db8140e..00e2a4a405 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt @@ -139,6 +139,7 @@ class ChaptersController : val coordinates = binding.fab.getCoordinates() binding.revealView.hideRevealEffect(coordinates.x, coordinates.y, 1920) } + super.onActivityResumed(activity) } @@ -457,9 +458,13 @@ class ChaptersController : private fun selectInverse() { val adapter = adapter ?: return + + selectedItems.clear() for (i in 0..adapter.itemCount) { adapter.toggleSelection(i) } + selectedItems.addAll(adapter.selectedPositions.mapNotNull { adapter.getItem(it) }) + actionMode?.invalidate() adapter.notifyDataSetChanged() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent/updates/UpdatesController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent/updates/UpdatesController.kt index c4dc2ba5d7..232002178a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent/updates/UpdatesController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent/updates/UpdatesController.kt @@ -265,9 +265,6 @@ class UpdatesController : presenter.deleteChapters(chaptersToDelete) } - /** - * Destory [ActionMode] if it's shown - */ private fun destroyActionModeIfNeeded() { actionMode?.finish() }