Use different string when custom version is set

This commit is contained in:
wingio 2023-03-30 14:43:12 -04:00
parent b3349f07ff
commit 096e657558
2 changed files with 9 additions and 3 deletions

View file

@ -110,18 +110,20 @@ class HomeScreen : ManagerTab {
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.fillMaxWidth()
) {
AnimatedVisibility(visible = viewModel.installManager.current != null) {
AnimatedVisibility(visible = currentVersion != null) {
Text(
text = "Current: ${viewModel.installManager.current?.versionName}",
text = stringResource(R.string.version_current, currentVersion.toString()),
style = MaterialTheme.typography.labelLarge,
color = LocalContentColor.current.copy(alpha = 0.5f),
textAlign = TextAlign.Center
)
}
val latestLabel = if(prefs.discordVersion.isNotBlank()) R.string.version_target else R.string.version_latest
AnimatedVisibility(visible = latestVersion != null) {
Text(
text = "Latest: $latestVersion",
text = stringResource(latestLabel, latestVersion.toString()),
style = MaterialTheme.typography.labelLarge,
color = LocalContentColor.current.copy(alpha = 0.5f),
textAlign = TextAlign.Center

View file

@ -106,4 +106,8 @@
<string name="label_special_thanks">Special thanks</string>
<string name="label_licenses">Open source licenses</string>
<string name="label_translate">Translate</string>
<string name="version_latest">Latest: %1$s</string>
<string name="version_target">Target: %1$s</string>
<string name="version_current">Current: %1$s</string>
</resources>