mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 20:48:00 +01:00
moving the default folder related code up
This commit is contained in:
parent
58a838f770
commit
564e56b20d
1 changed files with 23 additions and 23 deletions
|
@ -1123,6 +1123,29 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
|||
mDirs = dirs.clone() as ArrayList<Directory>
|
||||
}
|
||||
|
||||
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<Directory>) {
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue