From a9828948ac676d0a49e1d84e76fd77c855a7b2cf Mon Sep 17 00:00:00 2001 From: Agnieszka C <85929121+Aga-C@users.noreply.github.com> Date: Sun, 25 Dec 2022 11:33:52 +0100 Subject: [PATCH] Changed show hidden button in folder picker to include excluded (#2693) --- .../gallery/pro/dialogs/PickDirectoryDialog.kt | 4 ++-- .../com/simplemobiletools/gallery/pro/extensions/Context.kt | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickDirectoryDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickDirectoryDialog.kt index 30424e724..bf43fe15f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickDirectoryDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickDirectoryDialog.kt @@ -72,8 +72,8 @@ class PickDirectoryDialog( fetchDirectories(false) } - private fun fetchDirectories(forceShowHidden: Boolean) { - activity.getCachedDirectories(forceShowHidden = forceShowHidden) { + private fun fetchDirectories(forceShowHiddenAndExcluded: Boolean) { + activity.getCachedDirectories(forceShowHidden = forceShowHiddenAndExcluded, forceShowExcluded = forceShowHiddenAndExcluded) { if (it.isNotEmpty()) { it.forEach { it.subfoldersMediaCount = it.mediaCnt diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt index a6cd47ceb..fe01f1229 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt @@ -636,6 +636,7 @@ fun Context.getCachedDirectories( getVideosOnly: Boolean = false, getImagesOnly: Boolean = false, forceShowHidden: Boolean = false, + forceShowExcluded: Boolean = false, callback: (ArrayList) -> Unit ) { ensureBackgroundThread { @@ -655,7 +656,7 @@ fun Context.getCachedDirectories( } val shouldShowHidden = config.shouldShowHidden || forceShowHidden - val excludedPaths = if (config.temporarilyShowExcluded) { + val excludedPaths = if (config.temporarilyShowExcluded || forceShowExcluded) { HashSet() } else { config.excludedFolders