Skip to content

Commit e34186d

Browse files
committed
refactor(ui): update version display and optimize borders
Dynamically fetch version name from BuildConfig and memoize the gradient border brush in SettingsDialog for improved performance and maintainability.
1 parent 5ad4306 commit e34186d

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

app/src/main/java/com/example/ui/components/SettingsDialog.kt

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ fun SettingsScreen(
589589
color = MaterialTheme.colorScheme.onSurface
590590
)
591591
Text(
592-
text = "Version 1.0.8 • Jetpack Compose M3 • Multi-Profile Identities & Adblock",
592+
text = "Version ${com.example.BuildConfig.VERSION_NAME} • Jetpack Compose M3 • Multi-Profile Identities & Adblock",
593593
fontSize = 12.sp,
594594
color = MaterialTheme.colorScheme.onSurfaceVariant
595595
)
@@ -650,17 +650,22 @@ private fun GlassySettingsCard(
650650
)
651651
}
652652

653+
val outlineVariant = MaterialTheme.colorScheme.outlineVariant
654+
val borderBrush = remember(outlineVariant) {
655+
Brush.verticalGradient(
656+
colors = listOf(
657+
outlineVariant.copy(alpha = 0.45f),
658+
outlineVariant.copy(alpha = 0.12f)
659+
)
660+
)
661+
}
662+
653663
Surface(
654664
shape = RoundedCornerShape(18.dp),
655665
color = MaterialTheme.colorScheme.surfaceVariant.copy(alpha = 0.42f),
656666
border = BorderStroke(
657667
width = 1.dp,
658-
brush = Brush.verticalGradient(
659-
colors = listOf(
660-
MaterialTheme.colorScheme.outlineVariant.copy(alpha = 0.45f),
661-
MaterialTheme.colorScheme.outlineVariant.copy(alpha = 0.12f)
662-
)
663-
)
668+
brush = borderBrush
664669
),
665670
modifier = Modifier.fillMaxWidth()
666671
) {

0 commit comments

Comments
 (0)