compose: details: Add back download speed and time remaining text

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2025-08-25 21:27:26 +08:00
parent 51dea058b5
commit 682adc93d8
2 changed files with 15 additions and 1 deletions

View File

@@ -316,7 +316,9 @@ private fun ScreenContentApp(
inProgress = state.inProgress(),
progress = state.progress(),
onNavigateToDetailsDevProfile = { showExtraPane(Screen.DevProfile(it)) },
isUpdatable = state is AppState.Updatable
isUpdatable = state is AppState.Updatable,
speed = if (state is AppState.Downloading) state.speed else 0,
timeRemaining = if (state is AppState.Downloading) state.timeRemaining else 0
)
SetupAppActions()

View File

@@ -29,6 +29,7 @@ import com.aurora.store.R
import com.aurora.store.compose.composables.app.AnimatedAppIconComposable
import com.aurora.store.compose.preview.AppPreviewProvider
import com.aurora.store.compose.preview.coilPreviewProvider
import com.aurora.store.util.CommonUtil
import com.aurora.store.util.PackageUtil
/**
@@ -47,6 +48,8 @@ fun AppDetails(
inProgress: Boolean = false,
onNavigateToDetailsDevProfile: (developerName: String) -> Unit = {},
isUpdatable: Boolean = false,
speed: Long = 0,
timeRemaining: Long = 0
) {
val context = LocalContext.current
@@ -87,6 +90,15 @@ fun AppDetails(
},
style = MaterialTheme.typography.bodySmall
)
Text(
text = if (inProgress) {
CommonUtil.getDownloadSpeedString(context, speed) +
", " + CommonUtil.getETAString(context, timeRemaining)
} else {
""
},
style = MaterialTheme.typography.bodySmall
)
}
}
}