From ae6b53d464cd326d07bcad4b82b9714b89fc5400 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 14 May 2017 17:15:05 +0200 Subject: [PATCH] properly select the files to delete --- .../com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt | 2 +- .../com/simplemobiletools/gallery/adapters/MediaAdapter.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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)