diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index fd09fb158..e326c3fe4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -169,7 +169,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { if (!mWasMediaManagementPromptShown) { mWasMediaManagementPromptShown = true - handleMediaManagementPrompt { } + handleMediaManagementPrompt(false) { } } } } 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 7fa1d10da..8a162278a 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 @@ -485,7 +485,7 @@ class SettingsActivity : SimpleActivity() { private fun setupKeepLastModified() { settings_keep_last_modified.isChecked = config.keepLastModified settings_keep_last_modified_holder.setOnClickListener { - handleMediaManagementPrompt { + handleMediaManagementPrompt(false) { settings_keep_last_modified.toggle() config.keepLastModified = settings_keep_last_modified.isChecked } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt index 04680c25c..7f94ea3c9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt @@ -662,7 +662,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } private fun checkMediaManagementAndCopy(isCopyOperation: Boolean) { - handleMediaManagementPrompt { + handleMediaManagementPrompt(true) { copyMoveTo(isCopyOperation) } } @@ -1109,7 +1109,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View return } - handleMediaManagementPrompt { + handleMediaManagementPrompt(true) { if (config.isDeletePasswordProtectionOn) { handleDeletePasswordProtection { deleteConfirmed() @@ -1225,7 +1225,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View } private fun checkMediaManagementAndRename() { - handleMediaManagementPrompt { + handleMediaManagementPrompt(true) { renameFile() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt index b784dc0f2..e9d991951 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt @@ -235,7 +235,7 @@ class MediaAdapter( } private fun checkMediaManagementAndRename() { - activity.handleMediaManagementPrompt { + activity.handleMediaManagementPrompt(true) { renameFile() } } @@ -367,7 +367,7 @@ class MediaAdapter( } private fun checkMediaManagementAndCopy(isCopyOperation: Boolean) { - activity.handleMediaManagementPrompt { + activity.handleMediaManagementPrompt(true) { copyMoveTo(isCopyOperation) } } @@ -446,7 +446,7 @@ class MediaAdapter( } private fun checkDeleteConfirmation() { - activity.handleMediaManagementPrompt { + activity.handleMediaManagementPrompt(true) { if (config.isDeletePasswordProtectionOn) { activity.handleDeletePasswordProtection { deleteFiles() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt index 35985ac94..b006b3ebc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Activity.kt @@ -127,10 +127,10 @@ fun SimpleActivity.launchAbout() { startAboutActivity(R.string.app_name, licenses, BuildConfig.VERSION_NAME, faqItems, true) } -fun BaseSimpleActivity.handleMediaManagementPrompt(callback: () -> Unit) { +fun BaseSimpleActivity.handleMediaManagementPrompt(avoidShowingAllFiles: Boolean, callback: () -> Unit) { if (canManageMedia() || isExternalStorageManager()) { callback() - } else if (isRPlus() && resources.getBoolean(R.bool.require_all_files_access)) { + } else if (isRPlus() && resources.getBoolean(R.bool.require_all_files_access) && !avoidShowingAllFiles) { if (Environment.isExternalStorageManager()) { callback() } else {