mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 00:17:58 +01:00
properly select the files to delete
This commit is contained in:
parent
74da4b454b
commit
ae6b53d464
2 changed files with 2 additions and 2 deletions
|
@ -286,7 +286,7 @@ class DirectoryAdapter(val activity: SimpleActivity, val dirs: MutableList<Direc
|
||||||
}
|
}
|
||||||
|
|
||||||
activity.handleSAFDialog(File(needPermissionForPath)) {
|
activity.handleSAFDialog(File(needPermissionForPath)) {
|
||||||
selectedPositions.reversed().forEach {
|
selectedPositions.sortedDescending().forEach {
|
||||||
val directory = dirs[it]
|
val directory = dirs[it]
|
||||||
folders.add(File(directory.path))
|
folders.add(File(directory.path))
|
||||||
removeFolders.add(directory)
|
removeFolders.add(directory)
|
||||||
|
|
|
@ -223,7 +223,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList<Medium>,
|
||||||
val removeMedia = ArrayList<Medium>(selectedPositions.size)
|
val removeMedia = ArrayList<Medium>(selectedPositions.size)
|
||||||
|
|
||||||
activity.handleSAFDialog(File(media[selectedPositions.first()].path)) {
|
activity.handleSAFDialog(File(media[selectedPositions.first()].path)) {
|
||||||
selectedPositions.reversed().forEach {
|
selectedPositions.sortedDescending().forEach {
|
||||||
val medium = media[it]
|
val medium = media[it]
|
||||||
files.add(File(medium.path))
|
files.add(File(medium.path))
|
||||||
removeMedia.add(medium)
|
removeMedia.add(medium)
|
||||||
|
|
Loading…
Reference in a new issue