fix #735, remember last selected folder at adding excluded ones

This commit is contained in:
tibbi 2018-04-10 20:19:15 +02:00
parent 842df6b54c
commit 2bd20c5d98
5 changed files with 11 additions and 3 deletions

View File

@ -49,7 +49,8 @@ class ExcludedFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener {
}
private fun addFolder() {
FilePickerDialog(this, pickFile = false, showHidden = config.shouldShowHidden) {
FilePickerDialog(this, config.lastFilepickerPath, false, config.shouldShowHidden) {
config.lastFilepickerPath = it
config.addExcludedFolder(it)
updateFolders()
}

View File

@ -53,7 +53,8 @@ class HiddenFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener {
}
private fun addFolder() {
FilePickerDialog(this, pickFile = false, showHidden = config.shouldShowHidden) {
FilePickerDialog(this, config.lastFilepickerPath, false, config.shouldShowHidden) {
config.lastFilepickerPath = it
Thread {
addNoMedia(it) {
updateFolders()

View File

@ -50,7 +50,8 @@ class IncludedFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener {
}
private fun addFolder() {
FilePickerDialog(this, pickFile = false, showHidden = config.shouldShowHidden) {
FilePickerDialog(this, config.lastFilepickerPath, false, config.shouldShowHidden) {
config.lastFilepickerPath = it
config.addIncludedFolder(it)
updateFolders()
Thread {

View File

@ -326,4 +326,8 @@ class Config(context: Context) : BaseConfig(context) {
var wasNewAppShown: Boolean
get() = prefs.getBoolean(WAS_NEW_APP_SHOWN, false)
set(wasNewAppShown) = prefs.edit().putBoolean(WAS_NEW_APP_SHOWN, wasNewAppShown).apply()
var lastFilepickerPath: String
get() = prefs.getString(TEMP_FOLDER_PATH, "")
set(tempFolderPath) = prefs.edit().putString(TEMP_FOLDER_PATH, tempFolderPath).apply()
}

View File

@ -48,6 +48,7 @@ const val ALLOW_INSTANT_CHANGE = "allow_instant_change"
const val REPLACE_ZOOMABLE_IMAGES = "replace_zoomable_images"
const val DO_EXTRA_CHECK = "do_extra_check"
const val WAS_NEW_APP_SHOWN = "was_new_app_shown_clock"
const val LAST_FILEPICKER_PATH = "last_filepicker_path"
// slideshow
const val SLIDESHOW_INTERVAL = "slideshow_interval"