From 723f8481c3ffdbec9b4e67d5d94ffcb1d7b6dad8 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 26 Sep 2020 23:14:28 +0200 Subject: [PATCH] fix #413, add a button for showing Favorites at the destination picker --- app/build.gradle | 2 +- .../filemanager/pro/activities/DecompressActivity.kt | 2 +- .../filemanager/pro/activities/SaveAsActivity.kt | 2 +- .../filemanager/pro/adapters/ItemsAdapter.kt | 2 +- .../filemanager/pro/dialogs/CompressAsDialog.kt | 2 +- .../simplemobiletools/filemanager/pro/dialogs/SaveAsDialog.kt | 2 +- .../com/simplemobiletools/filemanager/pro/helpers/Config.kt | 4 ---- .../simplemobiletools/filemanager/pro/helpers/Constants.kt | 2 -- 8 files changed, 6 insertions(+), 12 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 54ccd030..4963142f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -58,7 +58,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.30.14' + implementation 'com.simplemobiletools:commons:5.30.16' implementation 'com.github.Stericson:RootTools:df729dcb13' implementation 'com.github.Stericson:RootShell:1.6' implementation 'com.alexvasilkov:gesture-views:2.5.2' diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/DecompressActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/DecompressActivity.kt index fdc76dd5..adf0a817 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/DecompressActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/DecompressActivity.kt @@ -79,7 +79,7 @@ class DecompressActivity : SimpleActivity() { private fun decompressFiles() { val defaultFolder = getRealPathFromURI(uri!!) ?: internalStoragePath - FilePickerDialog(this, defaultFolder, false, config.showHidden, true, true) { destination -> + FilePickerDialog(this, defaultFolder, false, config.showHidden, true, true, showFavoritesButton = true) { destination -> handleSAFDialog(destination) { if (it) { ensureBackgroundThread { diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/SaveAsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/SaveAsActivity.kt index 073bd3f6..315e3286 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/SaveAsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/SaveAsActivity.kt @@ -16,7 +16,7 @@ class SaveAsActivity : SimpleActivity() { setContentView(R.layout.activity_save_as) if (intent.action == Intent.ACTION_SEND && intent.extras?.containsKey(Intent.EXTRA_STREAM) == true) { - FilePickerDialog(this, pickFile = false, showHidden = config.shouldShowHidden, showFAB = true) { + FilePickerDialog(this, pickFile = false, showHidden = config.shouldShowHidden, showFAB = true, showFavoritesButton = true) { val destination = it handleSAFDialog(destination) { toast(R.string.saving) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ItemsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ItemsAdapter.kt index feac5757..7b7231a8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ItemsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ItemsAdapter.kt @@ -357,7 +357,7 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList - get() = prefs.getStringSet(FAVORITES, HashSet())!! - set(favorites) = prefs.edit().remove(FAVORITES).putStringSet(FAVORITES, favorites).apply() - var isRootAvailable: Boolean get() = prefs.getBoolean(IS_ROOT_AVAILABLE, false) set(isRootAvailable) = prefs.edit().putBoolean(IS_ROOT_AVAILABLE, isRootAvailable).apply() diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/helpers/Constants.kt index 700bbb5a..2e43e91c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/helpers/Constants.kt @@ -5,8 +5,6 @@ const val PATH = "path" // shared preferences const val SHOW_HIDDEN = "show_hidden" const val HOME_FOLDER = "home_folder" -const val FAVORITES = "favorites" -const val SORT_FOLDER_PREFIX = "sort_folder_" const val TEMPORARILY_SHOW_HIDDEN = "temporarily_show_hidden" const val IS_ROOT_AVAILABLE = "is_root_available" const val ENABLE_ROOT_ACCESS = "enable_root_access"