diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index f7b3161b7..863f323f3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -98,9 +98,17 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View return } - if (intent.extras?.containsKey(IS_VIEW_INTENT) == true && isShowHiddenFlagNeeded()) { - if (!config.isPasswordProtectionOn) { - config.temporarilyShowHidden = true + if (intent.extras?.containsKey(IS_VIEW_INTENT) == true) { + if (isShowHiddenFlagNeeded()) { + if (!config.isPasswordProtectionOn) { + config.temporarilyShowHidden = true + } + } + + config.excludedFolders.map { "$it/" }.forEach { + if (mPath.startsWith(it)) { + config.temporarilyShowExcluded = true + } } } @@ -145,6 +153,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View if (intent.extras?.containsKey(IS_VIEW_INTENT) == true) { config.temporarilyShowHidden = false } + config.temporarilyShowExcluded = false } private fun setupOrientationEventListener() { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt index bf93ade2d..6e812ccad 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt @@ -72,6 +72,7 @@ private fun parseCursor(context: Context, cur: Cursor, isPickImage: Boolean, isP val config = context.config val filterMedia = config.filterMedia val showHidden = config.shouldShowHidden + val showExcluded = config.temporarilyShowExcluded val includedFolders = config.includedFolders.map { "$it/" } val excludedFolders = config.excludedFolders.map { "$it/" } val noMediaFolders = context.getNoMediaFolders() @@ -137,7 +138,7 @@ private fun parseCursor(context: Context, cur: Cursor, isPickImage: Boolean, isP isExcluded = true } - if (!isExcluded) { + if (!isExcluded || showExcluded) { val dateTaken = cur.getLongValue(MediaStore.Images.Media.DATE_TAKEN) val dateModified = cur.getIntValue(MediaStore.Images.Media.DATE_MODIFIED) * 1000L diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt index 8ce4a8457..677b4a662 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Config.kt @@ -54,6 +54,10 @@ class Config(context: Context) : BaseConfig(context) { get() = prefs.getBoolean(TEMPORARILY_SHOW_HIDDEN, false) set(temporarilyShowHidden) = prefs.edit().putBoolean(TEMPORARILY_SHOW_HIDDEN, temporarilyShowHidden).apply() + var temporarilyShowExcluded: Boolean + get() = prefs.getBoolean(TEMPORARILY_SHOW_EXCLUDED, false) + set(temporarilyShowExcluded) = prefs.edit().putBoolean(TEMPORARILY_SHOW_EXCLUDED, temporarilyShowExcluded).apply() + var pinnedFolders: Set get() = prefs.getStringSet(PINNED_FOLDERS, HashSet()) set(pinnedFolders) = prefs.edit().putStringSet(PINNED_FOLDERS, pinnedFolders).apply() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt index 72ab0bc18..970629d2b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/helpers/Constants.kt @@ -6,6 +6,7 @@ val DIRECTORY_SORT_ORDER = "directory_sort_order" val SORT_FOLDER_PREFIX = "sort_folder_" val SHOW_HIDDEN_MEDIA = "show_hidden_media" val TEMPORARILY_SHOW_HIDDEN = "temporarily_show_hidden" +val TEMPORARILY_SHOW_EXCLUDED = "temporarily_show_excluded" val AUTOPLAY_VIDEOS = "autoplay_videos" val LOOP_VIDEOS = "loop_videos" val ANIMATE_GIFS = "animate_gifs"