diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index ba2395584..a0879f06e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -1123,6 +1123,29 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { mDirs = dirs.clone() as ArrayList } + private fun setAsDefaultFolder() { + config.defaultFolder = "" + invalidateOptionsMenu() + } + + private fun openDefaultFolder() { + if (config.defaultFolder.isEmpty()) { + return + } + + val defaultDir = File(config.defaultFolder) + + if ((!defaultDir.exists() || !defaultDir.isDirectory) && (config.defaultFolder != RECYCLE_BIN && config.defaultFolder != FAVORITES)) { + config.defaultFolder = "" + return + } + + Intent(this, MediaActivity::class.java).apply { + putExtra(DIRECTORY, config.defaultFolder) + handleMediaIntent(this) + } + } + private fun checkPlaceholderVisibility(dirs: ArrayList) { directories_empty_placeholder.beVisibleIf(dirs.isEmpty() && mLoadedInitialPhotos) directories_empty_placeholder_2.beVisibleIf(dirs.isEmpty() && mLoadedInitialPhotos) @@ -1412,27 +1435,4 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { checkWhatsNew(this, BuildConfig.VERSION_CODE) } } - - private fun setAsDefaultFolder() { - config.defaultFolder = "" - invalidateOptionsMenu() - } - - private fun openDefaultFolder() { - if (config.defaultFolder.isEmpty()) { - return - } - - val defaultDir = File(config.defaultFolder) - - if ((!defaultDir.exists() || !defaultDir.isDirectory) && (config.defaultFolder != RECYCLE_BIN && config.defaultFolder != FAVORITES)) { - config.defaultFolder = "" - return - } - - Intent(this, MediaActivity::class.java).apply { - putExtra(DIRECTORY, config.defaultFolder) - handleMediaIntent(this) - } - } }