From 87b7b817a86c6c74b30d730bb667e73700093cf5 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 21 Jan 2023 18:54:35 +0100 Subject: [PATCH] show Manage Included Folders without proper permissions too --- .../gallery/pro/activities/SettingsActivity.kt | 13 +++++++++++-- .../gallery/pro/dialogs/GrantAllFilesDialog.kt | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt index afa1c9d59..7fdd94368 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SettingsActivity.kt @@ -190,9 +190,18 @@ class SettingsActivity : SimpleActivity() { ) private fun setupManageIncludedFolders() { - settings_manage_included_folders_holder.beGoneIf(isRPlus() && !isExternalStorageManager()) + if (isRPlus() && !isExternalStorageManager()) { + settings_manage_included_folders.text = "${getString(R.string.manage_included_folders)} (${getString(R.string.no_permission)})" + } else { + settings_manage_included_folders.setText(R.string.manage_included_folders) + } + settings_manage_included_folders_holder.setOnClickListener { - startActivity(Intent(this, IncludedFoldersActivity::class.java)) + if (isRPlus() && !isExternalStorageManager()) { + GrantAllFilesDialog(this) + } else { + startActivity(Intent(this, IncludedFoldersActivity::class.java)) + } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/GrantAllFilesDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/GrantAllFilesDialog.kt index b6df18e28..226bf5d2d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/GrantAllFilesDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/GrantAllFilesDialog.kt @@ -19,7 +19,7 @@ class GrantAllFilesDialog(val activity: BaseSimpleActivity) { .setPositiveButton(R.string.ok) { dialog, which -> activity.launchGrantAllFilesIntent() } .setNegativeButton(R.string.cancel, null) .apply { - activity.setupDialogStuff(view, this, cancelOnTouchOutside = false) { alertDialog -> } + activity.setupDialogStuff(view, this) { alertDialog -> } } } }