Skip to content

Commit 12b96e1

Browse files
committed
optimizing the performance at fetching files
1 parent 935119f commit 12b96e1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ android {
5858
}
5959

6060
dependencies {
61-
implementation 'com.simplemobiletools:commons:5.30.16'
61+
implementation 'com.simplemobiletools:commons:5.30.18'
6262
implementation 'com.github.Stericson:RootTools:df729dcb13'
6363
implementation 'com.github.Stericson:RootShell:1.6'
6464
implementation 'com.alexvasilkov:gesture-views:2.5.2'

app/src/main/kotlin/com/simplemobiletools/filemanager/pro/adapters/ItemsAdapter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
309309
addFileUris(it.uri.toString(), paths)
310310
}
311311
} else {
312-
File(path).listFiles()?.filter { if (shouldShowHidden) true else !it.isHidden }?.forEach {
312+
File(path).listFiles()?.filter { if (shouldShowHidden) true else !it.name.startsWith('.') }?.forEach {
313313
addFileUris(it.absolutePath, paths)
314314
}
315315
}

app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/ItemsFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
239239
return null
240240
}
241241

242-
val isDirectory = file.isDirectory
242+
var lastModified = lastModifieds.remove(curPath)
243+
val isDirectory = if (lastModified != null) false else file.isDirectory
243244
val children = if (isDirectory) file.getDirectChildrenCount(showHidden) else 0
244245
val size = if (isDirectory) {
245246
if (isSortingBySize) {
@@ -251,7 +252,6 @@ class ItemsFragment : Fragment(), ItemOperationsListener, Breadcrumbs.Breadcrumb
251252
file.length()
252253
}
253254

254-
var lastModified = lastModifieds.remove(curPath)
255255
if (lastModified == null) {
256256
lastModified = file.lastModified()
257257
}

0 commit comments

Comments
 (0)