Forráskód Böngészése

Fix chapter list selection uninverting (closes #3014)

arkon 4 éve
szülő
commit
33d2b0984f

+ 5 - 0
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()
     }

+ 0 - 3
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()
     }