fix #381, apply the select sorting at the file pickers too

This commit is contained in:
tibbi 2020-03-26 12:38:57 +01:00
parent 2353dea92a
commit a5cdeaf59c
3 changed files with 3 additions and 19 deletions

View File

@ -58,7 +58,7 @@ android {
}
dependencies {
implementation 'com.simplemobiletools:commons:5.23.8'
implementation 'com.simplemobiletools:commons:5.23.13'
implementation 'com.github.Stericson:RootTools:df729dcb13'
implementation 'com.github.Stericson:RootShell:1.6'
implementation 'com.alexvasilkov:gesture-views:2.5.2'

View File

@ -63,9 +63,9 @@ class ChangeSortingDialog(val activity: BaseSimpleActivity, val path: String = "
}
if (view.sorting_dialog_use_for_this_folder.isChecked) {
config.saveFolderSorting(path, sorting)
config.saveCustomSorting(path, sorting)
} else {
config.removeFolderSorting(path)
config.removeCustomSorting(path)
config.sorting = sorting
}
callback()

View File

@ -62,22 +62,6 @@ class Config(context: Context) : BaseConfig(context) {
get() = prefs.getStringSet(FAVORITES, HashSet<String>())!!
set(favorites) = prefs.edit().remove(FAVORITES).putStringSet(FAVORITES, favorites).apply()
fun saveFolderSorting(path: String, value: Int) {
if (path.isEmpty()) {
sorting = value
} else {
prefs.edit().putInt(SORT_FOLDER_PREFIX + path, value).apply()
}
}
fun getFolderSorting(path: String) = prefs.getInt(SORT_FOLDER_PREFIX + path, sorting)
fun removeFolderSorting(path: String) {
prefs.edit().remove(SORT_FOLDER_PREFIX + path).apply()
}
fun hasCustomSorting(path: String) = prefs.contains(SORT_FOLDER_PREFIX + path)
var isRootAvailable: Boolean
get() = prefs.getBoolean(IS_ROOT_AVAILABLE, false)
set(isRootAvailable) = prefs.edit().putBoolean(IS_ROOT_AVAILABLE, isRootAvailable).apply()