change the toast message from Deleting to Moving to Recycle Bin when appropriate

This commit is contained in:
tibbi 2018-10-02 18:13:53 +02:00
parent e20013e982
commit 1c38f74ae7
3 changed files with 8 additions and 5 deletions

View file

@ -43,7 +43,7 @@ android {
} }
dependencies { 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.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'com.android.support:multidex:1.0.3' implementation 'com.android.support:multidex:1.0.3'
implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'it.sephiroth.android.exif:library:1.0.1'

View file

@ -425,7 +425,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
fileDirItems.isEmpty() -> return fileDirItems.isEmpty() -> return
fileDirItems.size == 1 -> toast(String.format(getString(R.string.deleting_folder), fileDirItems.first().name)) fileDirItems.size == 1 -> toast(String.format(getString(R.string.deleting_folder), fileDirItems.first().name))
else -> { 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) toast(deletingItems)
} }
} }

View file

@ -837,10 +837,10 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
return return
} }
val deletingItems = resources.getQuantityString(R.plurals.deleting_items, filtered.size, filtered.size)
toast(deletingItems)
if (config.useRecycleBin && !filtered.first().path.startsWith(filesDir.absolutePath)) { 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<String>, mMediumDao) { movePathsInRecycleBin(filtered.map { it.path } as ArrayList<String>, mMediumDao) {
if (it) { if (it) {
deleteFilteredFiles(filtered) deleteFilteredFiles(filtered)
@ -849,6 +849,8 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
} }
} }
} else { } else {
val deletingItems = resources.getQuantityString(R.plurals.deleting_items, filtered.size, filtered.size)
toast(deletingItems)
deleteFilteredFiles(filtered) deleteFilteredFiles(filtered)
} }
} }