From ad10f4123f1e8c4533d11fb501d064be10bab551 Mon Sep 17 00:00:00 2001 From: Naveen Date: Wed, 24 May 2023 04:53:15 +0530 Subject: [PATCH] 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 --- .../simplemobiletools/gallery/pro/adapters/MediaAdapter.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 6bdee1414..b906e3745 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 @@ -302,9 +302,11 @@ class MediaAdapter( if (!selectionContainsImages) { 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) - return !isRestrictedDir + return isExternalStorageManager() || (isCommonParent && !isRestrictedDir) } private fun toggleFileVisibility(hide: Boolean) {