From bf9441422b48a99643d5d2e7265cc739cd736f97 Mon Sep 17 00:00:00 2001 From: Bruno Deanoz Date: Mon, 22 Jun 2026 19:21:16 +0200 Subject: [PATCH] =?UTF-8?q?style=20CallButton=20to=20match=20SendButton=20?= =?UTF-8?q?=E2=80=94=20accent=20gradient,=20press=20animation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same 38dp circle as SendButton. Subtle accent gradient fill (16-28% alpha), AudioLines icon in accent.primary color, press-scale animation. Visually pairs with the send button as its idle counterpart. --- .../dev/kaizen/app/chat/ChatComponents.kt | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/dev/kaizen/app/chat/ChatComponents.kt b/app/src/main/java/dev/kaizen/app/chat/ChatComponents.kt index 1c22a52..bc9d4c7 100644 --- a/app/src/main/java/dev/kaizen/app/chat/ChatComponents.kt +++ b/app/src/main/java/dev/kaizen/app/chat/ChatComponents.kt @@ -593,12 +593,7 @@ fun ChatInput( if (hasContent) { SendButton(enabled = canSend, onClick = onSend) } else { - Box( - Modifier.size(38.dp).clip(KaizenShapes.circle).background(iconBg), - contentAlignment = Alignment.Center, - ) { - Icon(KaizenIcons.AudioLines, stringResource(R.string.chat_call), tint = cs.onSurfaceVariant, modifier = Modifier.size(19.dp)) - } + CallButton(onClick = { /* TODO: call feature */ }) } } } @@ -678,6 +673,35 @@ private fun SendButton(enabled: Boolean, onClick: () -> Unit) { } } +@Composable +private fun CallButton(onClick: () -> Unit) { + val cs = MaterialTheme.colorScheme + val isDark = isSystemInDarkTheme() + val interaction = remember { MutableInteractionSource() } + val pressed by interaction.collectIsPressedAsState() + val pressScale by animateFloatAsState(if (pressed) 0.88f else 1f, label = "call") + val accent = LocalKaizenAccent.current + + Box( + Modifier + .size(38.dp) + .scale(pressScale) + .clip(KaizenShapes.circle) + .background( + Brush.verticalGradient( + listOf( + accent.primary.copy(alpha = if (isDark) 0.22f else 0.16f), + accent.primaryDeep.copy(alpha = if (isDark) 0.28f else 0.22f), + ) + ) + ) + .clickable(interactionSource = interaction, indication = null, onClick = onClick), + contentAlignment = Alignment.Center, + ) { + Icon(KaizenIcons.AudioLines, null, tint = accent.primary, modifier = Modifier.size(19.dp)) + } +} + // ── Attachment rendering ──────────────────────────────────────────────────── private object NetworkImageCache {