diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt index d4a54bd3d..6f5abe839 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt @@ -42,7 +42,7 @@ import java.io.File class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList, val listener: DirectoryOperationsListener?, recyclerView: MyRecyclerView, val isPickIntent: Boolean, fastScroller: FastScroller? = null, itemClick: (Any) -> Unit) : - MyRecyclerViewAdapter(activity, recyclerView, fastScroller, itemClick) { + MyRecyclerViewAdapter(activity, recyclerView, fastScroller, itemClick) { private val config = activity.config private val isListViewType = config.viewTypeFolders == VIEW_TYPE_LIST @@ -439,12 +439,12 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList deleteFolders() else -> { val itemsCnt = selectedKeys.size - val items = if (itemsCnt == 1) { - var folder = getSelectedPaths().first().getFilenameFromPath() - if (folder == RECYCLE_BIN) { - folder = activity.getString(R.string.recycle_bin) + if (itemsCnt == 1 && getSelectedItems().first().isRecycleBin()) { + ConfirmationDialog(activity, "", R.string.empty_recycle_bin_confirmation, R.string.yes, R.string.no) { + deleteFolders() } + return + } + + val items = if (itemsCnt == 1) { + val folder = getSelectedPaths().first().getFilenameFromPath() "\"$folder\"" } else { resources.getQuantityString(R.plurals.delete_items, itemsCnt, itemsCnt) } val fileDirItem = getFirstSelectedItem() ?: return - val baseString = if (!config.useRecycleBin || (isOneItemSelected() && fileDirItem.isRecycleBin()) || (isOneItemSelected() && fileDirItem.areFavorites())) { + val baseString = if (!config.useRecycleBin || (isOneItemSelected() && fileDirItem.areFavorites())) { R.string.deletion_confirmation } else { R.string.move_to_recycle_bin_confirmation