style CallButton to match SendButton — accent gradient, press animation
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.
This commit is contained in:
parent
fd0de5ccef
commit
bf9441422b
1 changed files with 30 additions and 6 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue