fix: attachment menu — individual floating glass pills instead of card
Each option (camera, gallery, file) is its own GlassSurface pill with frosted glass blur, round colored icon, and shadow. No wrapping card.
This commit is contained in:
parent
43b2a72c96
commit
da01b57f08
1 changed files with 25 additions and 26 deletions
|
|
@ -475,44 +475,43 @@ fun AttachmentMenu(
|
||||||
onFile: () -> Unit,
|
onFile: () -> Unit,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
) {
|
) {
|
||||||
val cs = MaterialTheme.colorScheme
|
|
||||||
val accent = LocalKaizenAccent.current
|
val accent = LocalKaizenAccent.current
|
||||||
val isDark = isSystemInDarkTheme()
|
val isDark = isSystemInDarkTheme()
|
||||||
|
|
||||||
GlassSurface(
|
Column(
|
||||||
modifier = modifier.padding(horizontal = 12.dp),
|
modifier = modifier.padding(horizontal = 16.dp),
|
||||||
shape = KaizenShapes.lg,
|
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
tintAlpha = GlassTiers.card(isDark),
|
horizontalAlignment = Alignment.Start,
|
||||||
shadowStack = KaizenShadows.level2,
|
|
||||||
cornerRadius = 24.dp,
|
|
||||||
) {
|
) {
|
||||||
Column(Modifier.fillMaxWidth().padding(8.dp)) {
|
AttachPill(Icons.Rounded.CameraAlt, stringResource(R.string.attach_camera), accent.primary, isDark, onCamera)
|
||||||
AttachRow(Icons.Rounded.CameraAlt, stringResource(R.string.attach_camera), accent.primary, isDark, onCamera)
|
AttachPill(Icons.Rounded.Image, stringResource(R.string.attach_gallery), Color(0xFF6366F1), isDark, onGallery)
|
||||||
AttachRow(Icons.Rounded.Image, stringResource(R.string.attach_gallery), Color(0xFF6366F1), isDark, onGallery)
|
AttachPill(Icons.AutoMirrored.Rounded.InsertDriveFile, stringResource(R.string.attach_file), Color(0xFF10B981), isDark, onFile)
|
||||||
AttachRow(Icons.AutoMirrored.Rounded.InsertDriveFile, stringResource(R.string.attach_file), Color(0xFF10B981), isDark, onFile)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun AttachRow(icon: ImageVector, label: String, tint: Color, isDark: Boolean, onClick: () -> Unit) {
|
private fun AttachPill(icon: ImageVector, label: String, tint: Color, isDark: Boolean, onClick: () -> Unit) {
|
||||||
val cs = MaterialTheme.colorScheme
|
val cs = MaterialTheme.colorScheme
|
||||||
Row(
|
GlassSurface(
|
||||||
Modifier
|
shape = KaizenShapes.pill,
|
||||||
.fillMaxWidth()
|
tintAlpha = GlassTiers.pill(isDark),
|
||||||
.clip(KaizenShapes.md)
|
shadowStack = KaizenShadows.level2,
|
||||||
.clickable(onClick = onClick)
|
cornerRadius = 24.dp,
|
||||||
.padding(horizontal = 12.dp, vertical = 12.dp),
|
modifier = Modifier.clickable(onClick = onClick),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
) {
|
) {
|
||||||
Box(
|
Row(
|
||||||
Modifier.size(40.dp).clip(KaizenShapes.circle).background(tint.copy(alpha = if (isDark) 0.15f else 0.10f)),
|
Modifier.padding(start = 6.dp, end = 16.dp, top = 6.dp, bottom = 6.dp),
|
||||||
contentAlignment = Alignment.Center,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
Icon(icon, null, tint = tint, modifier = Modifier.size(20.dp))
|
Box(
|
||||||
|
Modifier.size(36.dp).clip(KaizenShapes.circle).background(tint.copy(alpha = if (isDark) 0.18f else 0.12f)),
|
||||||
|
contentAlignment = Alignment.Center,
|
||||||
|
) {
|
||||||
|
Icon(icon, null, tint = tint, modifier = Modifier.size(18.dp))
|
||||||
|
}
|
||||||
|
Spacer(Modifier.width(10.dp))
|
||||||
|
Text(label, color = cs.onBackground, fontSize = 14.sp, fontWeight = FontWeight.Medium)
|
||||||
}
|
}
|
||||||
Spacer(Modifier.width(14.dp))
|
|
||||||
Text(label, color = cs.onBackground, fontSize = 15.sp, fontWeight = FontWeight.Medium)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue