make sure some items are selected before trying to delete
This commit is contained in:
parent
78ae1f1d5d
commit
403dde02fb
|
@ -239,6 +239,10 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: MutableList<Direc
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun deleteFiles() {
|
private fun deleteFiles() {
|
||||||
|
if (selectedPositions.isEmpty()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
val folders = ArrayList<File>(selectedPositions.size)
|
val folders = ArrayList<File>(selectedPositions.size)
|
||||||
val removeFolders = ArrayList<Directory>(selectedPositions.size)
|
val removeFolders = ArrayList<Directory>(selectedPositions.size)
|
||||||
|
|
||||||
|
|
|
@ -215,6 +215,10 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Medium>,
|
||||||
private fun getCurrentPath() = media[selectedPositions.first()].path
|
private fun getCurrentPath() = media[selectedPositions.first()].path
|
||||||
|
|
||||||
private fun deleteFiles() {
|
private fun deleteFiles() {
|
||||||
|
if (selectedPositions.isEmpty()) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
val fileDirItems = ArrayList<FileDirItem>(selectedPositions.size)
|
val fileDirItems = ArrayList<FileDirItem>(selectedPositions.size)
|
||||||
val removeMedia = ArrayList<Medium>(selectedPositions.size)
|
val removeMedia = ArrayList<Medium>(selectedPositions.size)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue