Merge pull request #614 from NWuensche/foldersInRecents

Filter Folders from Recents-Tab
This commit is contained in:
Tibor Kaputa 2022-07-23 20:29:59 +02:00 committed by GitHub
commit b2c6bb7116
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,10 @@ 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