mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-02-28 01:27:38 +01:00
optimizing the performance at fetching files
This commit is contained in:
parent
935119f998
commit
12b96e159d
@ -58,7 +58,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.simplemobiletools:commons:5.30.16'
|
||||
implementation 'com.simplemobiletools:commons:5.30.18'
|
||||
implementation 'com.github.Stericson:RootTools:df729dcb13'
|
||||
implementation 'com.github.Stericson:RootShell:1.6'
|
||||
implementation 'com.alexvasilkov:gesture-views:2.5.2'
|
||||
|
@ -309,7 +309,7 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
|
||||
addFileUris(it.uri.toString(), paths)
|
||||
}
|
||||
} else {
|
||||
File(path).listFiles()?.filter { if (shouldShowHidden) true else !it.isHidden }?.forEach {
|
||||
File(path).listFiles()?.filter { if (shouldShowHidden) true else !it.name.startsWith('.') }?.forEach {
|
||||
addFileUris(it.absolutePath, paths)
|
||||
}
|
||||
}
|
||||
|
@ -239,7 +239,8 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
|
||||
return null
|
||||
}
|
||||
|
||||
val isDirectory = file.isDirectory
|
||||
var lastModified = lastModifieds.remove(curPath)
|
||||
val isDirectory = if (lastModified != null) false else file.isDirectory
|
||||
val children = if (isDirectory) file.getDirectChildrenCount(showHidden) else 0
|
||||
val size = if (isDirectory) {
|
||||
if (isSortingBySize) {
|
||||
@ -251,7 +252,6 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
|
||||
file.length()
|
||||
}
|
||||
|
||||
var lastModified = lastModifieds.remove(curPath)
|
||||
if (lastModified == null) {
|
||||
lastModified = file.lastModified()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user