allow deleting folders if some are selected

This commit is contained in:
tibbi 2017-03-15 23:04:39 +01:00
parent 2df4979dd5
commit 4202d9035c
2 changed files with 3 additions and 2 deletions

View File

@ -32,7 +32,7 @@ android {
}
dependencies {
compile 'com.simplemobiletools:commons:2.11.5'
compile 'com.simplemobiletools:commons:2.11.6'
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}

View File

@ -189,7 +189,8 @@ class ItemsFragment : android.support.v4.app.Fragment(), ItemsAdapter.ItemOperat
}
override fun deleteFiles(files: ArrayList<File>) {
(activity as SimpleActivity).deleteFiles(files) {
val hasFolder = files.any { it.isDirectory }
(activity as SimpleActivity).deleteFiles(files, hasFolder) {
if (!it) {
activity.runOnUiThread {
activity.toast(R.string.unknown_error_occurred)