mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-06-05 22:09:15 +02:00
optimizing the performance at fetching files
This commit is contained in:
@ -58,7 +58,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
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:RootTools:df729dcb13'
|
||||||
implementation 'com.github.Stericson:RootShell:1.6'
|
implementation 'com.github.Stericson:RootShell:1.6'
|
||||||
implementation 'com.alexvasilkov:gesture-views:2.5.2'
|
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)
|
addFileUris(it.uri.toString(), paths)
|
||||||
}
|
}
|
||||||
} else {
|
} 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)
|
addFileUris(it.absolutePath, paths)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,8 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
|
|||||||
return null
|
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 children = if (isDirectory) file.getDirectChildrenCount(showHidden) else 0
|
||||||
val size = if (isDirectory) {
|
val size = if (isDirectory) {
|
||||||
if (isSortingBySize) {
|
if (isSortingBySize) {
|
||||||
@ -251,7 +252,6 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
|
|||||||
file.length()
|
file.length()
|
||||||
}
|
}
|
||||||
|
|
||||||
var lastModified = lastModifieds.remove(curPath)
|
|
||||||
if (lastModified == null) {
|
if (lastModified == null) {
|
||||||
lastModified = file.lastModified()
|
lastModified = file.lastModified()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user