@@ -3,6 +3,7 @@ package com.OxGames.Pluvia.ui.screen.library
3
3
import android.content.Intent
4
4
import android.content.res.Configuration
5
5
import android.net.Uri
6
+ import androidx.compose.animation.AnimatedVisibility
6
7
import androidx.compose.foundation.layout.Box
7
8
import androidx.compose.foundation.layout.Column
8
9
import androidx.compose.foundation.layout.Row
@@ -83,11 +84,16 @@ fun AppScreen(
83
84
onBack : () -> Unit ,
84
85
) {
85
86
val context = LocalContext .current
86
- var downloadInfo by remember {
87
+ var downloadInfo by remember(appId) {
87
88
mutableStateOf(SteamService .getAppDownloadInfo(appId))
88
89
}
89
- var downloadProgress by remember { mutableFloatStateOf(downloadInfo?.getProgress() ? : 0f ) }
90
- var isInstalled by remember { mutableStateOf(SteamService .isAppInstalled(appId)) }
90
+ var downloadProgress by remember(appId) {
91
+ mutableFloatStateOf(downloadInfo?.getProgress() ? : 0f )
92
+ }
93
+ var isInstalled by remember(appId) {
94
+ mutableStateOf(SteamService .isAppInstalled(appId))
95
+ }
96
+
91
97
val isDownloading: () -> Boolean = { downloadInfo != null && downloadProgress < 1f }
92
98
93
99
var loadingDialogVisible by rememberSaveable { mutableStateOf(false ) }
@@ -455,20 +461,22 @@ private fun AppScreenContent(
455
461
}
456
462
457
463
if (isDownloading) {
458
- Column (
459
- modifier = Modifier
460
- .align(Alignment .CenterVertically )
461
- .weight(1f )
462
- .padding(4 .dp),
463
- ) {
464
- Text (
465
- modifier = Modifier .align(Alignment .End ),
466
- text = " ${(downloadProgress * 100f ).toInt()} %" ,
467
- )
468
- LinearProgressIndicator (
469
- modifier = Modifier .fillMaxWidth(),
470
- progress = { downloadProgress },
471
- )
464
+ AnimatedVisibility (visible = true ) {
465
+ Column (
466
+ modifier = Modifier
467
+ .align(Alignment .CenterVertically )
468
+ .weight(1f )
469
+ .padding(4 .dp),
470
+ ) {
471
+ Text (
472
+ modifier = Modifier .align(Alignment .End ),
473
+ text = " ${(downloadProgress * 100f ).toInt()} %" ,
474
+ )
475
+ LinearProgressIndicator (
476
+ modifier = Modifier .fillMaxWidth(),
477
+ progress = { downloadProgress },
478
+ )
479
+ }
472
480
}
473
481
} else {
474
482
Spacer (Modifier .weight(1f ))
0 commit comments