mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 04:28:00 +01:00
hide skip recycle bin option on delete dialog if file is already in recycle bin
This commit is contained in:
parent
bc85272855
commit
19a500f552
2 changed files with 7 additions and 3 deletions
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue