From 1e2f8cfed5243e3e67fc488702dcf7c4d5665f16 Mon Sep 17 00:00:00 2001 From: senseiGai Date: Sun, 11 Jan 2026 22:02:00 +0500 Subject: [PATCH] feat: Update Telegram send icon to horizontal design and adjust alignment in MessageInputBar --- .../messenger/ui/chats/ChatDetailScreen.kt | 55 +++++++++++-------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/com/rosetta/messenger/ui/chats/ChatDetailScreen.kt b/app/src/main/java/com/rosetta/messenger/ui/chats/ChatDetailScreen.kt index 05f9c1e..d0b7b16 100644 --- a/app/src/main/java/com/rosetta/messenger/ui/chats/ChatDetailScreen.kt +++ b/app/src/main/java/com/rosetta/messenger/ui/chats/ChatDetailScreen.kt @@ -62,11 +62,11 @@ import kotlinx.coroutines.launch // Telegram's CubicBezier interpolator (0.199, 0.010, 0.279, 0.910) val TelegramEasing = CubicBezierEasing(0.199f, 0.010f, 0.279f, 0.910f) -/** Telegram Send Icon (самолетик) - кастомная SVG иконка */ +/** Telegram Send Icon (горизонтальный самолетик) - кастомная SVG иконка */ private val TelegramSendIcon: ImageVector get() = ImageVector.Builder( - name = "TelegramSend", + name = "TelegramSendHorizontal", defaultWidth = 24.dp, defaultHeight = 24.dp, viewportWidth = 24f, @@ -80,17 +80,16 @@ private val TelegramSendIcon: ImageVector strokeLineCap = StrokeCap.Round, strokeLineJoin = StrokeJoin.Round ) { - // Path 1: M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 - // 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 - // 1.11z - moveTo(14.536f, 21.686f) - arcToRelative(0.5f, 0.5f, 0f, false, false, 0.937f, -0.024f) - lineToRelative(6.5f, -19f) - arcToRelative(0.496f, 0.496f, 0f, false, false, -0.635f, -0.635f) - lineToRelative(-19f, 6.5f) - arcToRelative(0.5f, 0.5f, 0f, false, false, -0.024f, 0.937f) - lineToRelative(7.93f, 3.18f) - arcToRelative(2f, 2f, 0f, false, true, 1.112f, 1.11f) + // Path 1: M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 + // 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z + moveTo(3.714f, 3.048f) + arcToRelative(0.498f, 0.498f, 0f, false, false, -0.683f, 0.627f) + lineToRelative(2.843f, 7.627f) + arcToRelative(2f, 2f, 0f, false, true, 0f, 1.396f) + lineToRelative(-2.842f, 7.627f) + arcToRelative(0.498f, 0.498f, 0f, false, false, 0.682f, 0.627f) + lineToRelative(18f, -8.5f) + arcToRelative(0.5f, 0.5f, 0f, false, false, 0f, -0.904f) close() } path( @@ -100,9 +99,9 @@ private val TelegramSendIcon: ImageVector strokeLineCap = StrokeCap.Round, strokeLineJoin = StrokeJoin.Round ) { - // Path 2: m21.854 2.147-10.94 10.939 - moveTo(21.854f, 2.147f) - lineToRelative(-10.94f, 10.939f) + // Path 2: M6 12h16 + moveTo(6f, 12f) + horizontalLineToRelative(16f) } } .build() @@ -989,12 +988,13 @@ private fun MessageInputBar( shape = RoundedCornerShape(22.dp) ) .padding(horizontal = 6.dp, vertical = 4.dp), - verticalAlignment = Alignment.CenterVertically + verticalAlignment = Alignment.Bottom ) { - // EMOJI BUTTON - слева внизу контейнера + // EMOJI BUTTON - выравнивается по низу Box( modifier = - Modifier.size(36.dp) + Modifier.align(Alignment.Bottom) + .size(36.dp) .clip(CircleShape) .clickable( interactionSource = interactionSource, @@ -1017,9 +1017,12 @@ private fun MessageInputBar( ) } - // TEXT INPUT - растягивается + // TEXT INPUT - растягивается и центрируется вертикально Box( - modifier = Modifier.weight(1f).padding(horizontal = 4.dp), + modifier = + Modifier.weight(1f) + .align(Alignment.CenterVertically) + .padding(horizontal = 4.dp), contentAlignment = Alignment.CenterStart ) { AppleEmojiTextField( @@ -1035,10 +1038,13 @@ private fun MessageInputBar( ) } - // ATTACH BUTTON - показывается всегда внизу + // ATTACH BUTTON - выравнивается по низу Box( modifier = - Modifier.size(36.dp).clip(CircleShape).clickable( + Modifier.align(Alignment.Bottom) + .size(36.dp) + .clip(CircleShape) + .clickable( interactionSource = interactionSource, indication = null ) { /* TODO: Attach */}, @@ -1059,7 +1065,8 @@ private fun MessageInputBar( // MIC / SEND BUTTON - Mic когда пусто, Send когда есть текст (Telegram style) Box( modifier = - Modifier.size(36.dp) + Modifier.align(Alignment.Bottom) + .size(36.dp) .clip(CircleShape) .then( if (canSend) {