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