disable recycle bin showing if the user tries to hide or exclude it

This commit is contained in:
tibbi 2018-07-26 14:01:51 +02:00
parent a8ea2ddbd8
commit 61d83750aa

View file

@ -192,7 +192,16 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
}
private fun toggleFoldersVisibility(hide: Boolean) {
getSelectedPaths().filter { it != FAVORITES && it != RECYCLE_BIN }.forEach {
val selectedPaths = getSelectedPaths()
if (hide && selectedPaths.contains(RECYCLE_BIN)) {
config.showRecycleBinAtFolders = false
if (selectedPaths.size == 1) {
listener?.refreshItems()
finishActMode()
}
}
selectedPaths.filter { it != FAVORITES && it != RECYCLE_BIN }.forEach {
val path = it
if (hide) {
if (config.wasHideFolderTooltipShown) {
@ -297,7 +306,16 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
}
private fun tryExcludeFolder() {
val paths = getSelectedPaths().filter { it != PATH && it != RECYCLE_BIN && it != FAVORITES }.toSet()
val selectedPaths = getSelectedPaths()
val paths = selectedPaths.filter { it != PATH && it != RECYCLE_BIN && it != FAVORITES }.toSet()
if (selectedPaths.contains(RECYCLE_BIN)) {
config.showRecycleBinAtFolders = false
if (selectedPaths.size == 1) {
listener?.refreshItems()
finishActMode()
}
}
if (paths.size == 1) {
ExcludeFolderDialog(activity, paths.toMutableList()) {
listener?.refreshItems()