mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-05-12 00:28:20 -04:00
fix(reactions): fix sent message reaction alignment (#4355)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
package org.meshtastic.feature.messaging.component
|
||||
|
||||
import android.content.ClipData
|
||||
import androidx.compose.animation.AnimatedVisibility
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.clickable
|
||||
@@ -342,20 +341,19 @@ internal fun MessageItem(
|
||||
}
|
||||
}
|
||||
}
|
||||
AnimatedVisibility(emojis.isNotEmpty()) {
|
||||
ReactionRow(
|
||||
modifier =
|
||||
Modifier.align(if (message.fromLocal) Alignment.End else Alignment.Start)
|
||||
.padding(
|
||||
start = if (!message.fromLocal) 0.dp else 24.dp,
|
||||
end = if (message.fromLocal) 0.dp else 24.dp,
|
||||
),
|
||||
reactions = if (message.fromLocal) emojis.reversed() else emojis,
|
||||
myId = ourNode.user.id,
|
||||
onSendReaction = sendReaction,
|
||||
onShowReactions = onShowReactions,
|
||||
)
|
||||
}
|
||||
|
||||
ReactionRow(
|
||||
modifier =
|
||||
Modifier.align(if (message.fromLocal) Alignment.End else Alignment.Start)
|
||||
.padding(
|
||||
start = if (!message.fromLocal) 0.dp else 24.dp,
|
||||
end = if (message.fromLocal) 0.dp else 24.dp,
|
||||
),
|
||||
reactions = if (message.fromLocal) emojis.reversed() else emojis,
|
||||
myId = ourNode.user.id,
|
||||
onSendReaction = sendReaction,
|
||||
onShowReactions = onShowReactions,
|
||||
)
|
||||
}
|
||||
|
||||
private const val SELECTED_ALPHA = 0.6f
|
||||
|
||||
@@ -146,12 +146,8 @@ internal fun ReactionRow(
|
||||
) {
|
||||
val emojiGroups = reactions.groupBy { it.emoji }
|
||||
|
||||
AnimatedVisibility(emojiGroups.isNotEmpty()) {
|
||||
LazyRow(
|
||||
modifier = modifier,
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(4.dp),
|
||||
) {
|
||||
AnimatedVisibility(emojiGroups.isNotEmpty(), modifier = modifier) {
|
||||
LazyRow(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(4.dp)) {
|
||||
items(emojiGroups.entries.toList()) { (emoji, reactions) ->
|
||||
val localReaction = reactions.find { it.user.id == DataPacket.ID_LOCAL || it.user.id == myId }
|
||||
ReactionItem(
|
||||
|
||||
Reference in New Issue
Block a user