mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-02-12 01:40:40 +01:00
small edit to fetching children
This commit is contained in:
parent
2c4ef37f15
commit
0d61293a10
@ -162,15 +162,13 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun getChildren(file: File): Int {
|
private fun getChildren(file: File): Int {
|
||||||
var fileList = file.list()
|
val fileList: Array<out String>? = file.list() ?: return 0
|
||||||
if (fileList == null)
|
|
||||||
return 0
|
|
||||||
|
|
||||||
if (file.isDirectory) {
|
if (file.isDirectory) {
|
||||||
return if (mShowHidden) {
|
return if (mShowHidden) {
|
||||||
fileList.size
|
fileList!!.size
|
||||||
} else {
|
} else {
|
||||||
fileList.count { fileName -> fileName[0] != '.' }
|
fileList!!.count { fileName -> fileName[0] != '.' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user