fix ChatInput — restore mic/call toggle, softer send button
Mic (voice recording) stays left next to +. Right side toggles between AudioLines icon (call, when empty) and send button (when content). Send button: removed border, translucent gradient, 38dp instead of 44dp.
This commit is contained in:
parent
313c21d47d
commit
70aa5c56da
2 changed files with 29 additions and 10 deletions
|
|
@ -575,23 +575,30 @@ fun ChatInput(
|
||||||
|
|
||||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
Box(
|
Box(
|
||||||
Modifier.size(40.dp).clip(KaizenShapes.circle).background(iconBg).clickable(onClick = onAddClick),
|
Modifier.size(38.dp).clip(KaizenShapes.circle).background(iconBg).clickable(onClick = onAddClick),
|
||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
) {
|
) {
|
||||||
Icon(KaizenIcons.Plus, stringResource(R.string.chat_attachment), tint = cs.onSurfaceVariant, modifier = Modifier.size(20.dp))
|
Icon(KaizenIcons.Plus, stringResource(R.string.chat_attachment), tint = cs.onSurfaceVariant, modifier = Modifier.size(19.dp))
|
||||||
}
|
}
|
||||||
Spacer(Modifier.width(8.dp))
|
Spacer(Modifier.width(8.dp))
|
||||||
Box(
|
Box(
|
||||||
Modifier.size(40.dp).clip(KaizenShapes.circle).background(iconBg),
|
Modifier.size(38.dp).clip(KaizenShapes.circle).background(iconBg),
|
||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
) {
|
) {
|
||||||
Icon(KaizenIcons.Mic, stringResource(R.string.chat_call), tint = cs.onSurfaceVariant, modifier = Modifier.size(20.dp))
|
Icon(KaizenIcons.Mic, stringResource(R.string.chat_attachment), tint = cs.onSurfaceVariant, modifier = Modifier.size(19.dp))
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer(Modifier.weight(1f))
|
Spacer(Modifier.weight(1f))
|
||||||
|
|
||||||
if (hasContent) {
|
if (hasContent) {
|
||||||
SendButton(enabled = canSend, onClick = onSend)
|
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))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -643,20 +650,31 @@ private fun PendingFileChip(pf: PendingFile, onRemove: () -> Unit) {
|
||||||
@Composable
|
@Composable
|
||||||
private fun SendButton(enabled: Boolean, onClick: () -> Unit) {
|
private fun SendButton(enabled: Boolean, onClick: () -> Unit) {
|
||||||
val cs = MaterialTheme.colorScheme
|
val cs = MaterialTheme.colorScheme
|
||||||
|
val isDark = isSystemInDarkTheme()
|
||||||
val interaction = remember { MutableInteractionSource() }
|
val interaction = remember { MutableInteractionSource() }
|
||||||
val pressed by interaction.collectIsPressedAsState()
|
val pressed by interaction.collectIsPressedAsState()
|
||||||
val pressScale by animateFloatAsState(if (pressed) 0.86f else 1f, label = "send")
|
val pressScale by animateFloatAsState(if (pressed) 0.88f else 1f, label = "send")
|
||||||
val accent = LocalKaizenAccent.current
|
val accent = LocalKaizenAccent.current
|
||||||
val fill = if (enabled) Modifier.background(Brush.linearGradient(listOf(accent.primary, accent.primaryDeep)))
|
|
||||||
else Modifier.background(cs.surface)
|
val fill = if (enabled) {
|
||||||
|
Modifier.background(
|
||||||
|
Brush.verticalGradient(
|
||||||
|
listOf(
|
||||||
|
accent.primary.copy(alpha = if (isDark) 0.85f else 0.80f),
|
||||||
|
accent.primaryDeep.copy(alpha = if (isDark) 0.90f else 0.85f),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
Modifier.background(cs.surfaceVariant.copy(alpha = 0.5f))
|
||||||
|
}
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
Modifier.size(44.dp).scale(pressScale).clip(KaizenShapes.circle).then(fill)
|
Modifier.size(38.dp).scale(pressScale).clip(KaizenShapes.circle).then(fill)
|
||||||
.border(1.dp, cs.outline, KaizenShapes.circle)
|
|
||||||
.clickable(interactionSource = interaction, indication = null, enabled = enabled, onClick = onClick),
|
.clickable(interactionSource = interaction, indication = null, enabled = enabled, onClick = onClick),
|
||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
) {
|
) {
|
||||||
SendArrow(color = if (enabled) accent.onPrimary else cs.onSurfaceVariant)
|
SendArrow(color = if (enabled) accent.onPrimary else cs.onSurfaceVariant.copy(alpha = 0.5f))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ object KaizenIcons {
|
||||||
// ── Chat ────────────────────────────────────────────────────────────────
|
// ── Chat ────────────────────────────────────────────────────────────────
|
||||||
val Mic: ImageVector get() = Lucide.Mic
|
val Mic: ImageVector get() = Lucide.Mic
|
||||||
val Paperclip: ImageVector get() = Lucide.Paperclip
|
val Paperclip: ImageVector get() = Lucide.Paperclip
|
||||||
|
val AudioLines: ImageVector get() = Lucide.AudioLines
|
||||||
val Plus: ImageVector get() = Lucide.Plus
|
val Plus: ImageVector get() = Lucide.Plus
|
||||||
val Send: ImageVector get() = Lucide.SendHorizontal
|
val Send: ImageVector get() = Lucide.SendHorizontal
|
||||||
val Sparkles: ImageVector get() = Lucide.Sparkles
|
val Sparkles: ImageVector get() = Lucide.Sparkles
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue