mirror of
https://github.com/fromchat-messenger/app.git
synced 2026-09-22 19:15:05 +03:00
Fix wrong message order and avatars
This commit is contained in:
@@ -329,8 +329,7 @@ fun ChatScreen(
|
||||
LazyColumn(
|
||||
state = listState,
|
||||
modifier = Modifier.fillMaxSize(), // Fill the entire space of the Box
|
||||
verticalArrangement = Arrangement.spacedBy(4.dp, alignment = Alignment.Bottom),
|
||||
reverseLayout = true // Display messages from bottom to top
|
||||
verticalArrangement = Arrangement.spacedBy(4.dp, alignment = Alignment.Bottom)
|
||||
) {
|
||||
item { Spacer(Modifier.height(innerPadding.calculateBottomPadding())) } // Spacer for chat input
|
||||
items(
|
||||
|
||||
@@ -81,6 +81,13 @@ fun MessageItem(
|
||||
verticalAlignment = Alignment.Bottom
|
||||
) {
|
||||
if (!isAuthor) {
|
||||
// Avatar at bottom
|
||||
Avatar(
|
||||
profilePictureUrl = message.profile_picture,
|
||||
displayName = message.username,
|
||||
size = 32.dp
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
}
|
||||
|
||||
@@ -196,18 +203,6 @@ fun MessageItem(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isAuthor) {
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
// Avatar at bottom
|
||||
Avatar(
|
||||
profilePictureUrl = message.profile_picture,
|
||||
displayName = message.username,
|
||||
size = 32.dp
|
||||
)
|
||||
} else {
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user