From b18af5e94e356f01d15cccbf1649c00230009ed7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 18 Jul 2018 15:02:56 +0200 Subject: [PATCH] do not show Recycle Bin and Favorites content at "Show all folders" --- .../simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt index e4b0aa1d8..26004f645 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt @@ -5,7 +5,9 @@ import android.os.AsyncTask import com.simplemobiletools.commons.helpers.SORT_BY_DATE_TAKEN import com.simplemobiletools.gallery.extensions.config import com.simplemobiletools.gallery.extensions.getFavoritePaths +import com.simplemobiletools.gallery.helpers.FAVORITES import com.simplemobiletools.gallery.helpers.MediaFetcher +import com.simplemobiletools.gallery.helpers.RECYCLE_BIN import com.simplemobiletools.gallery.helpers.SHOW_ALL import com.simplemobiletools.gallery.models.Medium import com.simplemobiletools.gallery.models.ThumbnailItem @@ -21,7 +23,7 @@ class GetMediaAsynctask(val context: Context, val mPath: String, val isPickImage val getProperDateTaken = context.config.getFileSorting(pathToUse) and SORT_BY_DATE_TAKEN != 0 val favoritePaths = context.getFavoritePaths() val media = if (showAll) { - val foldersToScan = mediaFetcher.getFoldersToScan() + val foldersToScan = mediaFetcher.getFoldersToScan().filter { it != RECYCLE_BIN && it != FAVORITES } val media = ArrayList() foldersToScan.forEach { val newMedia = mediaFetcher.getFilesFrom(it, isPickImage, isPickVideo, getProperDateTaken, favoritePaths)