Only allow resizing multiple images with common parents
Otherwise we'll have to create multiple SAF dialogs which just isn't practical/tedious for the user. Users can still resize images without common parents if they grant "All Files" access
This commit is contained in:
parent
295793c77f
commit
ad10f4123f
1 changed files with 4 additions and 2 deletions
|
@ -302,9 +302,11 @@ class MediaAdapter(
|
||||||
if (!selectionContainsImages) {
|
if (!selectionContainsImages) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
val parentPath = selectedItems.first { it.isImage() }.path.getParentPath()
|
|
||||||
|
val parentPath = selectedItems.first { it.isImage() }.parentPath
|
||||||
|
val isCommonParent = selectedItems.all { parentPath == it.parentPath }
|
||||||
val isRestrictedDir = activity.isRestrictedWithSAFSdk30(parentPath)
|
val isRestrictedDir = activity.isRestrictedWithSAFSdk30(parentPath)
|
||||||
return !isRestrictedDir
|
return isExternalStorageManager() || (isCommonParent && !isRestrictedDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun toggleFileVisibility(hide: Boolean) {
|
private fun toggleFileVisibility(hide: Boolean) {
|
||||||
|
|
Loading…
Reference in a new issue