Skip to content

Commit e72adf7

Browse files
authored
style: increase badge size on home screen for unread chats (#1023)
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 2eec5bc commit e72adf7

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

  • apps/flipcash/core/src/main/kotlin/com/flipcash/app/core/ui
  • ui/components/src/main/kotlin/com/getcode/ui/components

apps/flipcash/core/src/main/kotlin/com/flipcash/app/core/ui/NavigationBar.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ private fun BottomBarAction(
182182
Badge(
183183
count = badgeCount,
184184
color = CodeTheme.colors.indicator,
185+
scale = 1.275f,
185186
enterTransition = scaleIn(
186187
animationSpec = tween(
187188
durationMillis = 300,

ui/components/src/main/kotlin/com/getcode/ui/components/Badge.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ fun Badge(
4444
color: Color = CodeTheme.colors.brand,
4545
contentColor: Color = Color.White,
4646
textStyle: TextStyle = CodeTheme.typography.caption.copy(fontWeight = FontWeight.SemiBold),
47+
scale: Float = 1f,
4748
enterTransition: EnterTransition = scaleIn(tween(durationMillis = 300)) + fadeIn(),
4849
exitTransition: ExitTransition = fadeOut() + scaleOut(tween(durationMillis = 300))
4950
) {
@@ -59,17 +60,24 @@ fun Badge(
5960
else -> "$count"
6061
}
6162

63+
val scaledTextStyle = if (scale == 1f) textStyle else textStyle.copy(
64+
fontSize = textStyle.fontSize * scale
65+
)
66+
6267
Box(
6368
modifier = Modifier
6469
.squareMinSize()
6570
.clip(CircleShape)
6671
.background(color)
67-
.padding(horizontal = CodeTheme.dimens.grid.x1, vertical = 3.dp),
72+
.padding(
73+
horizontal = CodeTheme.dimens.grid.x1 * scale,
74+
vertical = 3.dp * scale,
75+
),
6876
contentAlignment = Alignment.Center
6977
) {
7078
Text(
7179
text = text,
72-
style = textStyle,
80+
style = scaledTextStyle,
7381
color = contentColor,
7482
)
7583
}

0 commit comments

Comments
 (0)