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:
Naveen 2023-05-24 04:53:15 +05:30
parent 295793c77f
commit ad10f4123f
No known key found for this signature in database
GPG key ID: 0E155DAD31671DA3

View file

@ -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) {