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 f34a23e9b..d2e1696bb 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 @@ -150,7 +150,7 @@ class WidgetConfigureActivity : SimpleActivity() { } private fun changeSelectedFolder() { - PickDirectoryDialog(this, "", false) { + PickDirectoryDialog(this, "", 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 c29f1e6b3..cf8f0b89e 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 @@ -14,7 +14,8 @@ import com.simplemobiletools.gallery.pro.helpers.VIEW_TYPE_GRID 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 callback: (path: String) -> Unit) { +class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: String, showOtherFolderButton: Boolean, val showFavoritesBin: Boolean, + val callback: (path: String) -> Unit) { private var dialog: AlertDialog private var shownDirectories = ArrayList() private var allDirectories = ArrayList() @@ -88,7 +89,8 @@ class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: Stri if (allDirectories.isEmpty()) { allDirectories = newDirs.clone() as ArrayList } - val distinctDirs = newDirs.distinctBy { it.path.getDistinctPath() }.toMutableList() as ArrayList + + val distinctDirs = newDirs.filter { showFavoritesBin || (!it.isRecycleBin() && !it.areFavorites()) }.distinctBy { it.path.getDistinctPath() }.toMutableList() as ArrayList val sortedDirs = activity.getSortedDirectories(distinctDirs) val dirs = activity.getDirsToShow(sortedDirs, allDirectories, currentPathPrefix).clone() as ArrayList if (dirs.hashCode() == shownDirectories.hashCode()) { 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 99509354b..036b1eadf 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 @@ -54,7 +54,7 @@ class PickMediumDialog(val activity: BaseSimpleActivity, val path: String, val c } private fun showOtherFolder() { - PickDirectoryDialog(activity, path, true) { + PickDirectoryDialog(activity, path, true, true) { 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 c2f273e6c..dfdafcc8c 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 @@ -208,7 +208,7 @@ fun BaseSimpleActivity.tryCopyMoveFilesTo(fileDirItems: ArrayList, } val source = fileDirItems[0].getParentPath() - PickDirectoryDialog(this, source, true) { + PickDirectoryDialog(this, source, true, false) { val destination = it handleSAFDialog(source) { if (it) {