compose: details: Show download speed and version on same line
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -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
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user