Skip to content

Commit da8202e

Browse files
authored
fix: set progress after computing total size (#253)
Refs: #251
1 parent 31d4fdb commit da8202e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Fixed
9+
- Fixed empty storage usage bars on initial load ([#251])
810

911
## [1.2.0] - 2025-07-12
1012
### Changed
@@ -58,6 +60,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5860
[#149]: https://github.com/FossifyOrg/File-Manager/issues/149
5961
[#150]: https://github.com/FossifyOrg/File-Manager/issues/150
6062
[#176]: https://github.com/FossifyOrg/File-Manager/issues/176
63+
[#251]: https://github.com/FossifyOrg/File-Manager/issues/251
6164

6265
[Unreleased]: https://github.com/FossifyOrg/File-Manager/compare/1.2.0...HEAD
6366
[1.2.0]: https://github.com/FossifyOrg/File-Manager/compare/1.1.0...1.2.0

app/src/main/kotlin/org/fossify/filemanager/fragments/StorageFragment.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
9595
}
9696

9797
totalSpace.text = String.format(context.getString(R.string.total_storage), "")
98-
getSizes(volumeName)
9998

10099
if (volumeNames.size > 1) {
101100
root.children.forEach { it.beGone() }
@@ -155,8 +154,7 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
155154
val tealColor = context.resources.getColor(R.color.md_teal_700)
156155
val pinkColor = context.resources.getColor(R.color.md_pink_700)
157156

158-
volumes.entries.forEach { (it, volumeBinding) ->
159-
getSizes(it)
157+
volumes.values.forEach { volumeBinding ->
160158
volumeBinding.apply {
161159
mainStorageUsageProgressbar.setIndicatorColor(properPrimaryColor)
162160
mainStorageUsageProgressbar.trackColor = properPrimaryColor.adjustAlpha(LOWER_ALPHA)
@@ -335,6 +333,7 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
335333
freeSpaceValue.text = freeStorageSpace.formatSizeThousand()
336334
totalSpace.text = String.format(context.getString(R.string.total_storage), totalStorageSpace.formatSizeThousand())
337335
freeSpaceLabel.beVisible()
336+
getSizes(volumeName)
338337
}
339338
}
340339
}
@@ -365,7 +364,6 @@ class StorageFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
365364
} else {
366365
showProgressBar()
367366
ensureBackgroundThread {
368-
val start = System.currentTimeMillis()
369367
val filtered = allDeviceListItems.filter { it.mName.contains(text, true) }.toMutableList() as ArrayList<ListItem>
370368
if (lastSearchedText != text) {
371369
return@ensureBackgroundThread

0 commit comments

Comments
 (0)