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,25 +78,25 @@ 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" +
stringResource( ", " + CommonUtil.getETAString(context, timeRemaining)
R.string.version_update, }
PackageUtil.getInstalledVersionName(context, app.packageName),
PackageUtil.getInstalledVersionCode(context, app.packageName), isUpdatable -> {
app.versionName, stringResource(
app.versionCode R.string.version_update,
) PackageUtil.getInstalledVersionName(context, app.packageName),
}, PackageUtil.getInstalledVersionCode(context, app.packageName),
style = MaterialTheme.typography.bodySmall app.versionName,
) app.versionCode
Text( )
text = if (inProgress) { }
"${Formatter.formatShortFileSize(context, speed)}/s" +
", " + CommonUtil.getETAString(context, timeRemaining) else -> {
} else { stringResource(R.string.version, app.versionName, app.versionCode)
"" }
}, },
style = MaterialTheme.typography.bodySmall style = MaterialTheme.typography.bodySmall
) )