fix: attachment menu — vertical glass panel with round colored icons
Replaced the horizontal circle buttons with a vertical GlassSurface panel. Each row has a 40dp round tinted icon + label, matching the app's glass design system. Slides up above the input with animation.
This commit is contained in:
parent
e1480fbb57
commit
5fbeded849
1 changed files with 24 additions and 40 deletions
|
|
@ -479,56 +479,40 @@ fun AttachmentMenu(
|
||||||
val accent = LocalKaizenAccent.current
|
val accent = LocalKaizenAccent.current
|
||||||
val isDark = isSystemInDarkTheme()
|
val isDark = isSystemInDarkTheme()
|
||||||
|
|
||||||
Row(
|
GlassSurface(
|
||||||
modifier = modifier.fillMaxWidth().padding(horizontal = 32.dp, vertical = 8.dp),
|
modifier = modifier.padding(horizontal = 12.dp),
|
||||||
horizontalArrangement = Arrangement.SpaceEvenly,
|
shape = KaizenShapes.lg,
|
||||||
|
tintAlpha = GlassTiers.card(isDark),
|
||||||
|
shadowStack = KaizenShadows.level2,
|
||||||
|
cornerRadius = 24.dp,
|
||||||
) {
|
) {
|
||||||
AttachOption(
|
Column(Modifier.fillMaxWidth().padding(8.dp)) {
|
||||||
icon = Icons.Rounded.CameraAlt,
|
AttachRow(Icons.Rounded.CameraAlt, stringResource(R.string.attach_camera), accent.primary, isDark, onCamera)
|
||||||
label = stringResource(R.string.attach_camera),
|
AttachRow(Icons.Rounded.Image, stringResource(R.string.attach_gallery), Color(0xFF6366F1), isDark, onGallery)
|
||||||
tint = accent.primary,
|
AttachRow(Icons.AutoMirrored.Rounded.InsertDriveFile, stringResource(R.string.attach_file), Color(0xFF10B981), isDark, onFile)
|
||||||
bg = accent.primary.copy(alpha = if (isDark) 0.15f else 0.10f),
|
}
|
||||||
onClick = onCamera,
|
|
||||||
)
|
|
||||||
AttachOption(
|
|
||||||
icon = Icons.Rounded.Image,
|
|
||||||
label = stringResource(R.string.attach_gallery),
|
|
||||||
tint = Color(0xFF6366F1),
|
|
||||||
bg = Color(0xFF6366F1).copy(alpha = if (isDark) 0.15f else 0.10f),
|
|
||||||
onClick = onGallery,
|
|
||||||
)
|
|
||||||
AttachOption(
|
|
||||||
icon = Icons.AutoMirrored.Rounded.InsertDriveFile,
|
|
||||||
label = stringResource(R.string.attach_file),
|
|
||||||
tint = Color(0xFF10B981),
|
|
||||||
bg = Color(0xFF10B981).copy(alpha = if (isDark) 0.15f else 0.10f),
|
|
||||||
onClick = onFile,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun AttachOption(
|
private fun AttachRow(icon: ImageVector, label: String, tint: Color, isDark: Boolean, onClick: () -> Unit) {
|
||||||
icon: ImageVector,
|
|
||||||
label: String,
|
|
||||||
tint: Color,
|
|
||||||
bg: Color,
|
|
||||||
onClick: () -> Unit,
|
|
||||||
) {
|
|
||||||
val cs = MaterialTheme.colorScheme
|
val cs = MaterialTheme.colorScheme
|
||||||
Column(horizontalAlignment = Alignment.CenterHorizontally) {
|
Row(
|
||||||
Box(
|
|
||||||
Modifier
|
Modifier
|
||||||
.size(56.dp)
|
.fillMaxWidth()
|
||||||
.clip(KaizenShapes.circle)
|
.clip(KaizenShapes.md)
|
||||||
.background(bg)
|
.clickable(onClick = onClick)
|
||||||
.clickable(onClick = onClick),
|
.padding(horizontal = 12.dp, vertical = 12.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
) {
|
||||||
|
Box(
|
||||||
|
Modifier.size(40.dp).clip(KaizenShapes.circle).background(tint.copy(alpha = if (isDark) 0.15f else 0.10f)),
|
||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
) {
|
) {
|
||||||
Icon(icon, null, tint = tint, modifier = Modifier.size(24.dp))
|
Icon(icon, null, tint = tint, modifier = Modifier.size(20.dp))
|
||||||
}
|
}
|
||||||
Spacer(Modifier.height(6.dp))
|
Spacer(Modifier.width(14.dp))
|
||||||
Text(label, color = cs.onSurfaceVariant, fontSize = 12.sp, fontWeight = FontWeight.Medium)
|
Text(label, color = cs.onBackground, fontSize = 15.sp, fontWeight = FontWeight.Medium)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue