Анимация, список реакций
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3,6 +3,7 @@ package chats.presentation.components
|
|||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.*
|
import androidx.compose.foundation.layout.*
|
||||||
|
import androidx.compose.foundation.lazy.items
|
||||||
import androidx.compose.foundation.combinedClickable
|
import androidx.compose.foundation.combinedClickable
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
@@ -647,32 +648,64 @@ fun MessageContextMenu(
|
|||||||
onReactionSelected: (String) -> Unit,
|
onReactionSelected: (String) -> Unit,
|
||||||
onAction: (String) -> Unit
|
onAction: (String) -> Unit
|
||||||
) {
|
) {
|
||||||
androidx.compose.material3.Surface(
|
var isVisible by remember { mutableStateOf(false) }
|
||||||
modifier = Modifier
|
|
||||||
.width(220.dp)
|
LaunchedEffect(Unit) {
|
||||||
.clip(RoundedCornerShape(12.dp)),
|
isVisible = true
|
||||||
color = Color(0xFF1E1E1E),
|
}
|
||||||
shadowElevation = 8.dp
|
|
||||||
) {
|
androidx.compose.animation.AnimatedVisibility(
|
||||||
Column {
|
visible = isVisible,
|
||||||
// Reactions
|
enter = androidx.compose.animation.fadeIn(animationSpec = androidx.compose.animation.core.tween(200)) +
|
||||||
Row(
|
androidx.compose.animation.scaleIn(
|
||||||
modifier = Modifier
|
initialScale = 0.5f,
|
||||||
.fillMaxWidth()
|
animationSpec = androidx.compose.animation.core.spring(
|
||||||
.padding(8.dp),
|
dampingRatio = 0.6f,
|
||||||
horizontalArrangement = Arrangement.SpaceBetween
|
stiffness = 400f
|
||||||
) {
|
),
|
||||||
listOf("👍", "❤️", "😂", "😮", "😢", "🔥").forEach { emoji ->
|
transformOrigin = androidx.compose.ui.graphics.TransformOrigin(
|
||||||
Text(
|
if (isVisible) 0.5f else 0.5f,
|
||||||
text = emoji,
|
0f
|
||||||
fontSize = 24.sp,
|
|
||||||
modifier = Modifier
|
|
||||||
.clip(CircleShape)
|
|
||||||
.clickable { onReactionSelected(emoji) }
|
|
||||||
.padding(4.dp)
|
|
||||||
)
|
)
|
||||||
|
),
|
||||||
|
exit = androidx.compose.animation.fadeOut() + androidx.compose.animation.scaleOut()
|
||||||
|
) {
|
||||||
|
androidx.compose.material3.Surface(
|
||||||
|
modifier = Modifier
|
||||||
|
.width(280.dp) // Even wider for all reactions
|
||||||
|
.clip(RoundedCornerShape(20.dp)),
|
||||||
|
color = Color(0xFF1E1E1E),
|
||||||
|
shadowElevation = 15.dp,
|
||||||
|
border = androidx.compose.foundation.BorderStroke(0.5.dp, Color.White.copy(alpha = 0.15f))
|
||||||
|
) {
|
||||||
|
Column {
|
||||||
|
// Extended Reactions scrollable bar
|
||||||
|
androidx.compose.foundation.lazy.LazyRow(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(horizontal = 4.dp, vertical = 10.dp),
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(6.dp),
|
||||||
|
contentPadding = PaddingValues(horizontal = 12.dp)
|
||||||
|
) {
|
||||||
|
val telegramReactions = listOf(
|
||||||
|
"👍", "❤️", "😂", "🔥", "💯", "👏", "🤩", "🤔", "🤯", "😱", "🤬",
|
||||||
|
"👎", "💩", "🤡", "🥳", "😇", "🌚", "🙏", "👌", "🕊️", "🐳",
|
||||||
|
"🌭", "🦄", "🍌", "💊", "🍓", "🍾", "💋", "🖕", "👀", "👻",
|
||||||
|
"🤝", "🤣", "⚡", "✨", "🎈", "🎉", "🧊", "🆒", "🤨", "😐",
|
||||||
|
"🤷♂️", "💅", "🏆", "👾", "🎯", "🎲", "🍷", "🤮", "🥱", "😴",
|
||||||
|
"🤐", "🥴"
|
||||||
|
)
|
||||||
|
items(telegramReactions) { emoji ->
|
||||||
|
Text(
|
||||||
|
text = emoji,
|
||||||
|
fontSize = 28.sp,
|
||||||
|
modifier = Modifier
|
||||||
|
.clip(CircleShape)
|
||||||
|
.clickable { onReactionSelected(emoji) }
|
||||||
|
.padding(4.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Divider(color = Color.White.copy(alpha = 0.1f))
|
Divider(color = Color.White.copy(alpha = 0.1f))
|
||||||
|
|
||||||
@@ -694,6 +727,7 @@ fun MessageContextMenu(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ContextMenuItem(
|
fun ContextMenuItem(
|
||||||
|
|||||||
Reference in New Issue
Block a user