From 50e6b98d0935516e5980940c3a92f960b34a4887 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 21 Oct 2021 13:32:41 +0200 Subject: [PATCH] adding some recycle bin refreshing related improvements --- .../gallery/pro/activities/MainActivity.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index a78efb4dd..bec348551 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -942,6 +942,16 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { val lastModifieds = mLastMediaFetcher!!.getLastModifieds() val dateTakens = mLastMediaFetcher!!.getDateTakens() + if (config.showRecycleBinAtFolders && !config.showRecycleBinLast && !dirs.map { it.path }.contains(RECYCLE_BIN)) { + val recycleBin = Directory().apply { + path = RECYCLE_BIN + name = getString(R.string.recycle_bin) + location = LOCATION_INTERNAL + } + + dirs.add(0, recycleBin) + } + try { for (directory in dirs) { if (mShouldStopFetching || isDestroyed || isFinishing) { @@ -1044,7 +1054,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { foldersToScan.remove(RECYCLE_BIN) } - dirs.forEach { + dirs.filterNot { it.path == RECYCLE_BIN }.forEach { foldersToScan.remove(it.path) }