diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt index 685b0d63d..80073046e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -102,7 +102,6 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, override fun onPrepareActionMode(actionMode: ActionMode?, menu: Menu): Boolean { menu.findItem(R.id.cab_rename).isVisible = multiSelector.selectedPositions.size <= 1 menu.findItem(R.id.cab_edit).isVisible = multiSelector.selectedPositions.size <= 1 - return true } @@ -170,7 +169,14 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, } fun selectAll() { - + val cnt = media.size + for (i in 0..cnt - 1) { + markedItems.add(i) + multiSelector.setSelected(i, 0, true) + notifyItemChanged(i) + } + actMode?.title = cnt.toString() + actMode?.invalidate() } private fun askConfirmDelete() {