make sure some items are selected before trying to delete
This commit is contained in:
parent
78ae1f1d5d
commit
403dde02fb
2 changed files with 8 additions and 0 deletions
|
@ -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 a new issue