diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/fragments/ItemsFragment.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/fragments/ItemsFragment.kt index 8711f289..05003223 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/fragments/ItemsFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/fragments/ItemsFragment.kt @@ -162,14 +162,15 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener { } private fun getChildren(file: File): Int { - if (file.listFiles() == null) + var fileList = file.list() + if (fileList == null) return 0 if (file.isDirectory) { return if (mShowHidden) { - file.listFiles()?.size ?: 0 + fileList.size } else { - file.listFiles { file -> !file.isHidden }?.size ?: 0 + fileList.count { fileName -> fileName[0] != '.' } } } return 0