From dc600070af4e1fd6909b56875c5f8c1bbfee1f90 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 21 Sep 2018 10:53:21 +0200 Subject: [PATCH] do not list all folders being deleted, just the count --- .../gallery/activities/MainActivity.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 29e220b8a..154c96a04 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -421,12 +421,13 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { override fun deleteFolders(folders: ArrayList) { val fileDirItems = folders.asSequence().filter { it.isDirectory }.map { FileDirItem(it.absolutePath, it.name, true) }.toMutableList() as ArrayList - if (fileDirItems.isEmpty()) { - return - } - - fileDirItems.forEach { - toast(String.format(getString(R.string.deleting_folder), it.name)) + when { + fileDirItems.isEmpty() -> return + fileDirItems.size == 1 -> toast(String.format(getString(R.string.deleting_folder), fileDirItems.first().name)) + else -> { + val deletingItems = resources.getQuantityString(R.plurals.deleting_items, fileDirItems.size, fileDirItems.size) + toast(deletingItems) + } } if (config.useRecycleBin) {