mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-04-26 07:58:48 +02:00
show only the wanted file type at regular files
This commit is contained in:
parent
d286ca7e41
commit
61c4acc18b
@ -207,9 +207,22 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
|
|||||||
for (file in files) {
|
for (file in files) {
|
||||||
val fileDirItem = getFileDirItemFromFile(file, isSortingBySize, lastModifieds, false)
|
val fileDirItem = getFileDirItemFromFile(file, isSortingBySize, lastModifieds, false)
|
||||||
if (fileDirItem != null) {
|
if (fileDirItem != null) {
|
||||||
|
val mimetype = file.getMimeType()
|
||||||
|
val isProperMimeType = if (getContentMimeType.isEmpty() || file.isDirectory) {
|
||||||
|
true
|
||||||
|
} else {
|
||||||
|
if (getContentMimeType.endsWith("/*")) {
|
||||||
|
mimetype.substringBefore("/").equals(getContentMimeType.substringBefore("/"), true)
|
||||||
|
} else {
|
||||||
|
mimetype.equals(getContentMimeType, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isProperMimeType) {
|
||||||
items.add(fileDirItem)
|
items.add(fileDirItem)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// send out the initial item list asap, get proper child count asynchronously as it can be slow
|
// send out the initial item list asap, get proper child count asynchronously as it can be slow
|
||||||
callback(path, items)
|
callback(path, items)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user