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