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