diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index 9454f0ca4..490e9a14f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -215,10 +215,11 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList) { activity.config.albumCovers = Gson().toJson(albumCovers) actMode?.finish() diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt index e60443001..e72a3395c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickDirectoryDialog.kt @@ -37,16 +37,16 @@ class PickDirectoryDialog(val activity: SimpleActivity, val sourcePath: String, .setNeutralButton(R.string.other_folder, { dialogInterface, i -> showOtherFolder() }) .create().apply { activity.setupDialogStuff(view, this, R.string.select_destination) - - val dirs = activity.getCachedDirectories() - if (dirs.isNotEmpty()) { - gotDirectories(activity.addTempFolderIfNeeded(dirs)) - } - - GetDirectoriesAsynctask(activity, false, false) { - gotDirectories(activity.addTempFolderIfNeeded(it)) - }.execute() } + + val dirs = activity.getCachedDirectories() + if (dirs.isNotEmpty()) { + gotDirectories(activity.addTempFolderIfNeeded(dirs)) + } + + GetDirectoriesAsynctask(activity, false, false) { + gotDirectories(activity.addTempFolderIfNeeded(it)) + }.execute() } private fun showOtherFolder() { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt index 5770685ad..3596a6907 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/PickMediumDialog.kt @@ -31,17 +31,25 @@ class PickMediumDialog(val activity: SimpleActivity, val path: String, val callb dialog = AlertDialog.Builder(activity) .setPositiveButton(R.string.ok, null) .setNegativeButton(R.string.cancel, null) + .setNeutralButton(R.string.other_folder, { dialogInterface, i -> showOtherFolder() }) .create().apply { activity.setupDialogStuff(view, this, R.string.select_photo) + } - val media = activity.getCachedMedia(path).filter { !it.video } as ArrayList - if (media.isNotEmpty()) { - gotMedia(media) - } + val media = activity.getCachedMedia(path).filter { !it.video } as ArrayList + if (media.isNotEmpty()) { + gotMedia(media) + } - GetMediaAsynctask(activity, path, false, true, false) { - gotMedia(it) - }.execute() + GetMediaAsynctask(activity, path, false, true, false) { + gotMedia(it) + }.execute() + } + + private fun showOtherFolder() { + PickDirectoryDialog(activity, path) { + callback(it) + dialog.dismiss() } }