diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/WidgetConfigureActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/WidgetConfigureActivity.kt index a93ccc346..70350e275 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/WidgetConfigureActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/WidgetConfigureActivity.kt @@ -152,7 +152,7 @@ class WidgetConfigureActivity : SimpleActivity() { } private fun changeSelectedFolder() { - PickDirectoryDialog(this, "", false, true) { + PickDirectoryDialog(this, "", false, true, false, true) { updateFolderImage(it) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickDirectoryDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickDirectoryDialog.kt index 8f8f25f66..84ebcb37e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickDirectoryDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickDirectoryDialog.kt @@ -16,7 +16,12 @@ import com.simplemobiletools.gallery.pro.models.Directory import kotlinx.android.synthetic.main.dialog_directory_picker.view.* class PickDirectoryDialog( - val activity: BaseSimpleActivity, val sourcePath: String, showOtherFolderButton: Boolean, val showFavoritesBin: Boolean, + val activity: BaseSimpleActivity, + val sourcePath: String, + showOtherFolderButton: Boolean, + val showFavoritesBin: Boolean, + val isPickingCopyMoveDestination: Boolean, + val isPickingFolderForWidget: Boolean, val callback: (path: String) -> Unit ) { private var dialog: AlertDialog @@ -81,7 +86,7 @@ class PickDirectoryDialog( } private fun showOtherFolder() { - FilePickerDialog(activity, sourcePath, false, showHidden, true, true) { + FilePickerDialog(activity, sourcePath, !isPickingCopyMoveDestination && !isPickingFolderForWidget, showHidden, true, true) { activity.handleLockedFolderOpening(it) { success -> if (success) { callback(it) @@ -108,10 +113,10 @@ class PickDirectoryDialog( val clickedDir = it as Directory val path = clickedDir.path if (clickedDir.subfoldersCount == 1 || !activity.config.groupDirectSubfolders) { - if (path.trimEnd('/') == sourcePath) { + if (isPickingCopyMoveDestination && path.trimEnd('/') == sourcePath) { activity.toast(R.string.source_and_destination_same) return@DirectoryAdapter - } else if (activity.isRestrictedWithSAFSdk30(path) && !activity.isInDownloadDir(path)) { + } else if (isPickingCopyMoveDestination && activity.isRestrictedWithSAFSdk30(path) && !activity.isInDownloadDir(path)) { activity.toast(R.string.system_folder_restriction, Toast.LENGTH_LONG) return@DirectoryAdapter } else { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickMediumDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickMediumDialog.kt index a2837ebc5..e15877f4d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickMediumDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/dialogs/PickMediumDialog.kt @@ -58,7 +58,7 @@ class PickMediumDialog(val activity: BaseSimpleActivity, val path: String, val c } private fun showOtherFolder() { - PickDirectoryDialog(activity, path, true, true) { + PickDirectoryDialog(activity, path, true, true, false, false) { callback(it) dialog.dismiss() } 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 cc482f169..cd887cd4b 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 @@ -246,7 +246,7 @@ fun BaseSimpleActivity.tryCopyMoveFilesTo(fileDirItems: ArrayList, } val source = fileDirItems[0].getParentPath() - PickDirectoryDialog(this, source, true, false) { + PickDirectoryDialog(this, source, true, false, true, false) { val destination = it handleSAFDialog(source) { if (it) {