diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 805d88198..a01474b0e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -652,6 +652,14 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { } private fun gotDirectories(newDirs: ArrayList) { + // if hidden item showing is disabled but all Favorite items are hidden, hide the Favorites folder + if (!config.shouldShowHidden) { + val favoritesFolder = newDirs.firstOrNull { it.areFavorites() } + if (favoritesFolder != null && favoritesFolder.tmb.getFilenameFromPath().startsWith('.')) { + newDirs.remove(favoritesFolder) + } + } + val dirs = getSortedDirectories(newDirs) var isPlaceholderVisible = dirs.isEmpty()