diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index 360797efb..f275910cd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -286,7 +286,7 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList, val removeMedia = ArrayList(selectedPositions.size) activity.handleSAFDialog(File(media[selectedPositions.first()].path)) { - selectedPositions.reversed().forEach { + selectedPositions.sortedDescending().forEach { val medium = media[it] files.add(File(medium.path)) removeMedia.add(medium)