update the delete confirmation Dialog if we are using the recycle bin

This commit is contained in:
tibbi 2018-06-27 09:28:24 +02:00
parent 3bedb2282c
commit 3468a9860b
3 changed files with 6 additions and 3 deletions

View file

@ -829,7 +829,8 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
} }
private fun askConfirmDelete() { private fun askConfirmDelete() {
DeleteWithRememberDialog(this, getString(R.string.proceed_with_deletion)) { val message = if (config.useRecycleBin) R.string.are_you_sure_recycle_bin else R.string.are_you_sure_delete
DeleteWithRememberDialog(this, getString(message)) {
config.tempSkipDeleteConfirmation = it config.tempSkipDeleteConfirmation = it
deleteConfirmed() deleteConfirmed()
} }

View file

@ -327,7 +327,8 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
} else { } else {
val itemsCnt = selectedPositions.size val itemsCnt = selectedPositions.size
val items = resources.getQuantityString(R.plurals.delete_items, itemsCnt, itemsCnt) val items = resources.getQuantityString(R.plurals.delete_items, itemsCnt, itemsCnt)
var question = String.format(resources.getString(R.string.deletion_confirmation), items) val baseString = if (config.useRecycleBin) R.string.move_to_recycle_bin_confirmation else R.string.deletion_confirmation
var question = String.format(resources.getString(baseString), items)
val warning = resources.getQuantityString(R.plurals.delete_warning, itemsCnt, itemsCnt) val warning = resources.getQuantityString(R.plurals.delete_warning, itemsCnt, itemsCnt)
question += "\n\n$warning" question += "\n\n$warning"
ConfirmationDialog(activity, question) { ConfirmationDialog(activity, question) {

View file

@ -279,7 +279,8 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Thumbnai
private fun askConfirmDelete() { private fun askConfirmDelete() {
val items = resources.getQuantityString(R.plurals.delete_items, selectedPositions.size, selectedPositions.size) val items = resources.getQuantityString(R.plurals.delete_items, selectedPositions.size, selectedPositions.size)
val question = String.format(resources.getString(R.string.deletion_confirmation), items) val baseString = if (config.useRecycleBin) R.string.move_to_recycle_bin_confirmation else R.string.deletion_confirmation
val question = String.format(resources.getString(baseString), items)
DeleteWithRememberDialog(activity, question) { DeleteWithRememberDialog(activity, question) {
config.tempSkipDeleteConfirmation = it config.tempSkipDeleteConfirmation = it
deleteFiles() deleteFiles()