File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
src/main/kotlin/com/d4rk/cleaner/ui/memory Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ android {
14
14
applicationId = " com.d4rk.cleaner"
15
15
minSdk = 26
16
16
targetSdk = 34
17
- versionCode = 88
17
+ versionCode = 89
18
18
versionName = " 2.0.0"
19
19
archivesName = " ${applicationId} -v${versionName} "
20
20
testInstrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ import com.d4rk.cleaner.utils.PermissionsUtils
69
69
import com.d4rk.cleaner.utils.cleaning.FileUtils.formatSize
70
70
import com.d4rk.cleaner.utils.compose.components.StorageProgressBar
71
71
import com.d4rk.cleaner.utils.compose.bounceClick
72
+ import kotlinx.coroutines.delay
72
73
import kotlin.math.absoluteValue
73
74
import kotlin.math.min
74
75
@@ -109,6 +110,11 @@ fun MemoryManagerComposable() {
109
110
if (! PermissionsUtils .hasStoragePermissions(context)) {
110
111
PermissionsUtils .requestStoragePermissions(context as Activity )
111
112
}
113
+
114
+ while (true ) {
115
+ delay(5000 )
116
+ viewModel.updateRamInfo(context)
117
+ }
112
118
}
113
119
if (isLoading) {
114
120
Box (
Original file line number Diff line number Diff line change @@ -58,11 +58,7 @@ class MemoryManagerViewModel : ViewModel() {
58
58
*/
59
59
fun updateRamInfo (context : Context ) {
60
60
viewModelScope.launch {
61
- try {
62
- _ramInfo .value = getRamInfo(context)
63
- } finally {
64
- _isLoading .value = false
65
- }
61
+ _ramInfo .value = getRamInfo(context)
66
62
}
67
63
}
68
64
You can’t perform that action at this time.
0 commit comments