fix: input style

This commit is contained in:
k1ngsterr1
2026-02-01 21:38:52 +05:00
parent b05f526b43
commit 0ba33419dd

View File

@@ -693,7 +693,7 @@ private fun TelegramRotateBar(
/**
* Telegram-style caption input bar
* Меняет внешний вид в зависимости от состояния клавиатуры:
* - Клавиатура закрыта: минимальный стиль (камера + текст + синяя стрелка)
* - Клавиатура закрыта: стеклянный инпут с blur эффектом (не на всю ширину)
* - Клавиатура открыта: полный стиль (emoji + текст + галочка)
*/
@Composable
@@ -705,17 +705,37 @@ private fun TelegramCaptionBar(
onSend: () -> Unit
) {
// Анимированный переход между стилями
val backgroundAlpha by animateFloatAsState(
targetValue = if (isKeyboardVisible) 0.75f else 0f,
val cornerRadius by animateDpAsState(
targetValue = if (isKeyboardVisible) 0.dp else 24.dp,
animationSpec = tween(200, easing = TelegramEasing),
label = "background"
label = "corner"
)
Row(
val horizontalPadding by animateDpAsState(
targetValue = if (isKeyboardVisible) 0.dp else 12.dp,
animationSpec = tween(200, easing = TelegramEasing),
label = "hPadding"
)
Box(
modifier = Modifier
.fillMaxWidth()
.background(Color.Black.copy(alpha = backgroundAlpha))
.padding(horizontal = 12.dp, vertical = 10.dp),
.padding(horizontal = horizontalPadding)
.then(
if (isKeyboardVisible) {
// Клавиатура открыта - полупрозрачный черный фон на всю ширину
Modifier.background(Color.Black.copy(alpha = 0.75f))
} else {
// Клавиатура закрыта - стеклянный эффект с закруглением
Modifier
.clip(RoundedCornerShape(cornerRadius))
.background(Color(0xFF2C2C2E).copy(alpha = 0.85f))
}
)
.padding(horizontal = 12.dp, vertical = 10.dp)
) {
Row(
modifier = Modifier.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(10.dp)
) {
@@ -738,7 +758,7 @@ private fun TelegramCaptionBar(
} else {
// Клавиатура закрыта - камера иконка
Icon(
TablerIcons.Camera,
TablerIcons.CameraPlus,
contentDescription = "Camera",
tint = Color.White.copy(alpha = 0.7f),
modifier = Modifier.size(26.dp)
@@ -807,6 +827,7 @@ private fun TelegramCaptionBar(
}
}
}
}
}
/** Save edited image and return the URI - crops black bars from FIT_CENTER */