Skip to content

Commit 6bd133f

Browse files
committed
small UI improvements
1 parent 35609c8 commit 6bd133f

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

app/src/main/java/in/hridayan/ashell/settings/presentation/components/dialog/LatestVersionDialog.kt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,15 @@ import `in`.hridayan.ashell.core.presentation.utils.syncedRotationAndScale
4242
fun LatestVersionDialog(onDismiss: () -> Unit) {
4343
val (angle, scale) = syncedRotationAndScale()
4444
val appVersionName = stringResource(R.string.version_name) + ": " + BuildConfig.VERSION_NAME
45-
val appVersionCode =
46-
stringResource(R.string.version_code) + ": " + BuildConfig.VERSION_CODE.toString()
45+
46+
@Suppress("KotlinConstantConditions")
47+
val flavorDisplay = when (BuildConfig.FLAVOR) {
48+
BuildConfig.DIST_FLAVOR_GITHUB -> "GitHub"
49+
BuildConfig.DIST_FLAVOR_FDROID -> "F-Droid"
50+
else -> stringResource(R.string.unknown)
51+
}
52+
53+
val appVersionCode = stringResource(R.string.flavor) + ": " + flavorDisplay
4754

4855
DialogContainer(onDismiss = onDismiss) {
4956
Box(
@@ -83,14 +90,14 @@ fun LatestVersionDialog(onDismiss: () -> Unit) {
8390
horizontalAlignment = Alignment.CenterHorizontally,
8491
verticalArrangement = Arrangement.spacedBy(10.dp)
8592
) {
86-
AnimatedInfoCard(appVersionName)
87-
AnimatedInfoCard(appVersionCode)
93+
InfoChip(appVersionName)
94+
InfoChip(appVersionCode)
8895
}
8996
}
9097
}
9198

9299
@Composable
93-
private fun AnimatedInfoCard(text: String) {
100+
private fun InfoChip(text: String) {
94101
CustomCard(
95102
shape = CustomCardShape(50),
96103
colors = CardDefaults.cardColors(

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@
496496
<string name="turn_off_mobile_data">Turn off Mobile Data if the Wifi connection has NO INTERNET</string>
497497
<string name="tweak_your_experience">Tweak your experience</string>
498498
<string name="type">Type</string>
499+
<string name="flavor">Flavor</string>
499500
<string name="undo">Undo</string>
500501
<string name="unknown">Unknown</string>
501502
<string name="unknown_error">Unknown error occurred</string>

0 commit comments

Comments
 (0)