avoid showing the All Files access popup at file operations
This commit is contained in:
parent
a93da8fdad
commit
54fb75f5a7
|
@ -169,7 +169,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
|||
|
||||
if (!mWasMediaManagementPromptShown) {
|
||||
mWasMediaManagementPromptShown = true
|
||||
handleMediaManagementPrompt { }
|
||||
handleMediaManagementPrompt(false) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue