From 1c38f74ae7cbbf67c6a2d54f1de7678cd2a3da1b Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 2 Oct 2018 18:13:53 +0200 Subject: [PATCH] change the toast message from Deleting to Moving to Recycle Bin when appropriate --- app/build.gradle | 2 +- .../simplemobiletools/gallery/activities/MainActivity.kt | 3 ++- .../simplemobiletools/gallery/activities/MediaActivity.kt | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 6800312b8..5ce75a811 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -43,7 +43,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:4.8.4' + implementation 'com.simplemobiletools:commons:4.8.5' implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0' implementation 'com.android.support:multidex:1.0.3' implementation 'it.sephiroth.android.exif:library:1.0.1' 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 154c96a04..30ad07426 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -425,7 +425,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { 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) + val baseString = if (config.useRecycleBin) R.plurals.moving_items_into_bin else R.plurals.delete_items + val deletingItems = resources.getQuantityString(baseString, fileDirItems.size, fileDirItems.size) toast(deletingItems) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index 5cb161a06..da83fef12 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -837,10 +837,10 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { return } - val deletingItems = resources.getQuantityString(R.plurals.deleting_items, filtered.size, filtered.size) - toast(deletingItems) - if (config.useRecycleBin && !filtered.first().path.startsWith(filesDir.absolutePath)) { + val movingItems = resources.getQuantityString(R.plurals.moving_items_into_bin, filtered.size, filtered.size) + toast(movingItems) + movePathsInRecycleBin(filtered.map { it.path } as ArrayList, mMediumDao) { if (it) { deleteFilteredFiles(filtered) @@ -849,6 +849,8 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { } } } else { + val deletingItems = resources.getQuantityString(R.plurals.deleting_items, filtered.size, filtered.size) + toast(deletingItems) deleteFilteredFiles(filtered) } }