fix #807, show a warning when deleting a folder

This commit is contained in:
tibbi 2018-06-14 10:23:10 +02:00
parent 284a12666f
commit b80e02d14f
2 changed files with 6 additions and 3 deletions

View file

@ -47,7 +47,7 @@ ext {
}
dependencies {
implementation 'com.simplemobiletools:commons:4.1.10'
implementation 'com.simplemobiletools:commons:4.1.11'
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'

View file

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