From 0f9f6592d151798167525efcf0ab7419adc0e8f6 Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Tue, 30 Jun 2026 13:21:08 -0400 Subject: [PATCH] style: increase badge size on home screen for unread chats Signed-off-by: Brandon McAnsh --- .../kotlin/com/flipcash/app/core/ui/NavigationBar.kt | 1 + .../main/kotlin/com/getcode/ui/components/Badge.kt | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/flipcash/core/src/main/kotlin/com/flipcash/app/core/ui/NavigationBar.kt b/apps/flipcash/core/src/main/kotlin/com/flipcash/app/core/ui/NavigationBar.kt index 33c4d1b1f..22b2faa5c 100644 --- a/apps/flipcash/core/src/main/kotlin/com/flipcash/app/core/ui/NavigationBar.kt +++ b/apps/flipcash/core/src/main/kotlin/com/flipcash/app/core/ui/NavigationBar.kt @@ -182,6 +182,7 @@ private fun BottomBarAction( Badge( count = badgeCount, color = CodeTheme.colors.indicator, + scale = 1.275f, enterTransition = scaleIn( animationSpec = tween( durationMillis = 300, diff --git a/ui/components/src/main/kotlin/com/getcode/ui/components/Badge.kt b/ui/components/src/main/kotlin/com/getcode/ui/components/Badge.kt index 69bda0cae..155807605 100644 --- a/ui/components/src/main/kotlin/com/getcode/ui/components/Badge.kt +++ b/ui/components/src/main/kotlin/com/getcode/ui/components/Badge.kt @@ -44,6 +44,7 @@ fun Badge( color: Color = CodeTheme.colors.brand, contentColor: Color = Color.White, textStyle: TextStyle = CodeTheme.typography.caption.copy(fontWeight = FontWeight.SemiBold), + scale: Float = 1f, enterTransition: EnterTransition = scaleIn(tween(durationMillis = 300)) + fadeIn(), exitTransition: ExitTransition = fadeOut() + scaleOut(tween(durationMillis = 300)) ) { @@ -59,17 +60,24 @@ fun Badge( else -> "$count" } + val scaledTextStyle = if (scale == 1f) textStyle else textStyle.copy( + fontSize = textStyle.fontSize * scale + ) + Box( modifier = Modifier .squareMinSize() .clip(CircleShape) .background(color) - .padding(horizontal = CodeTheme.dimens.grid.x1, vertical = 3.dp), + .padding( + horizontal = CodeTheme.dimens.grid.x1 * scale, + vertical = 3.dp * scale, + ), contentAlignment = Alignment.Center ) { Text( text = text, - style = textStyle, + style = scaledTextStyle, color = contentColor, ) }