mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-01-29 17:59:17 +01:00
fix #381, apply the select sorting at the file pickers too
This commit is contained in:
parent
2353dea92a
commit
a5cdeaf59c
@ -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'
|
||||
|
@ -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()
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user