hide skip recycle bin option on delete dialog if file is already in recycle bin

This commit is contained in:
fatih ergin 2023-07-25 00:59:14 +03:00
parent bc85272855
commit 19a500f552
2 changed files with 7 additions and 3 deletions

View file

@ -1070,15 +1070,18 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
val size = fileDirItem.getProperSize(this, countHidden = true).formatSize()
val filename = "\"${getCurrentPath().getFilenameFromPath()}\""
val filenameAndSize = "$filename ($size)"
val isInRecycleBin = getCurrentMedium()!!.getIsInRecycleBin()
val baseString = if (config.useRecycleBin && !config.tempSkipRecycleBin && !getCurrentMedium()!!.getIsInRecycleBin()) {
val baseString = if (config.useRecycleBin && !config.tempSkipRecycleBin && !isInRecycleBin) {
R.string.move_to_recycle_bin_confirmation
} else {
R.string.deletion_confirmation
}
val message = String.format(resources.getString(baseString), filenameAndSize)
DeleteWithRememberDialog(this, message, config.useRecycleBin) { remember, skipRecycleBin ->
val showSkipRecycleBinOption = config.useRecycleBin && !isInRecycleBin
DeleteWithRememberDialog(this, message, showSkipRecycleBinOption) { remember, skipRecycleBin ->
config.tempSkipDeleteConfirmation = remember
if (remember) {

View file

@ -508,8 +508,9 @@ class MediaAdapter(
val baseString =
if (config.useRecycleBin && !config.tempSkipRecycleBin && !isRecycleBin) R.string.move_to_recycle_bin_confirmation else R.string.deletion_confirmation
val question = String.format(resources.getString(baseString), itemsAndSize)
val showSkipRecycleBinOption = config.useRecycleBin && !isRecycleBin
DeleteWithRememberDialog(activity, question, config.useRecycleBin) { remember, skipRecycleBin ->
DeleteWithRememberDialog(activity, question, showSkipRecycleBinOption) { remember, skipRecycleBin ->
config.tempSkipDeleteConfirmation = remember
if (remember) {