compose: details: Show download speed and version on same line

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2025-09-01 15:58:17 +08:00
parent 0afc9cc0fd
commit 63b7bbb031

View File

@@ -78,9 +78,13 @@ fun Details(
color = MaterialTheme.colorScheme.primary color = MaterialTheme.colorScheme.primary
) )
Text( Text(
text = if (!isUpdatable) { text = when {
stringResource(R.string.version, app.versionName, app.versionCode) inProgress -> {
} else { "${Formatter.formatShortFileSize(context, speed)}/s" +
", " + CommonUtil.getETAString(context, timeRemaining)
}
isUpdatable -> {
stringResource( stringResource(
R.string.version_update, R.string.version_update,
PackageUtil.getInstalledVersionName(context, app.packageName), PackageUtil.getInstalledVersionName(context, app.packageName),
@@ -88,15 +92,11 @@ fun Details(
app.versionName, app.versionName,
app.versionCode app.versionCode
) )
}, }
style = MaterialTheme.typography.bodySmall
) else -> {
Text( stringResource(R.string.version, app.versionName, app.versionCode)
text = if (inProgress) { }
"${Formatter.formatShortFileSize(context, speed)}/s" +
", " + CommonUtil.getETAString(context, timeRemaining)
} else {
""
}, },
style = MaterialTheme.typography.bodySmall style = MaterialTheme.typography.bodySmall
) )