From 4bcc1815825eea6e0431145ea4f3406be1d3ef2c Mon Sep 17 00:00:00 2001 From: nwuensche Date: Sun, 17 Jul 2022 15:42:32 +0200 Subject: [PATCH 1/2] Filter Folders from Recents-Tab Solves #613 --- .../filemanager/pro/fragments/RecentsFragment.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/RecentsFragment.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/RecentsFragment.kt index 8945e201..feefab07 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/RecentsFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/RecentsFragment.kt @@ -24,6 +24,7 @@ import com.simplemobiletools.filemanager.pro.helpers.RootHelpers import com.simplemobiletools.filemanager.pro.interfaces.ItemOperationsListener import com.simplemobiletools.filemanager.pro.models.ListItem import kotlinx.android.synthetic.main.recents_fragment.view.* +import java.io.File class RecentsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerFragment(context, attributeSet), ItemOperationsListener { private val RECENTS_LIMIT = 50 @@ -141,6 +142,9 @@ class RecentsFragment(context: Context, attributeSet: AttributeSet) : MyViewPage if (cursor.moveToFirst()) { do { val path = cursor.getStringValue(FileColumns.DATA) + + if (File(path).isDirectory) continue + val name = cursor.getStringValue(FileColumns.DISPLAY_NAME) ?: path.getFilenameFromPath() val size = cursor.getLongValue(FileColumns.SIZE) val modified = cursor.getLongValue(FileColumns.DATE_MODIFIED) * 1000 From 5ed8b18e0429e25e399a7033b405956aec81318e Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Sat, 23 Jul 2022 20:29:45 +0200 Subject: [PATCH 2/2] minor style update --- .../filemanager/pro/fragments/RecentsFragment.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/RecentsFragment.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/RecentsFragment.kt index feefab07..ce225aa1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/RecentsFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/RecentsFragment.kt @@ -142,8 +142,9 @@ class RecentsFragment(context: Context, attributeSet: AttributeSet) : MyViewPage if (cursor.moveToFirst()) { do { val path = cursor.getStringValue(FileColumns.DATA) - - if (File(path).isDirectory) continue + if (File(path).isDirectory) { + continue + } val name = cursor.getStringValue(FileColumns.DISPLAY_NAME) ?: path.getFilenameFromPath() val size = cursor.getLongValue(FileColumns.SIZE)