mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Make sure that files grid in chat bubble is using at most 3 columns
This commit is contained in:
parent
21398c7b37
commit
b6279b03c0
1 changed files with 9 additions and 4 deletions
|
|
@ -436,6 +436,11 @@ class MessageModel
|
|||
|
||||
displayableContentFound = true
|
||||
} else {
|
||||
val wrapBefore = if (exactly4Contents) {
|
||||
contentIndex == 2 // To have a 2x2 grid
|
||||
} else {
|
||||
contentIndex % 3 == 0 // To have at most 3 columns
|
||||
}
|
||||
if (content.isFile) {
|
||||
Log.d("$TAG Found file content with type [${content.type}/${content.subtype}]")
|
||||
contentIndex += 1
|
||||
|
|
@ -456,8 +461,6 @@ class MessageModel
|
|||
Log.d(
|
||||
"$TAG Found file ready to be displayed [$path] with MIME [${content.type}/${content.subtype}] for message [${chatMessage.messageId}]"
|
||||
)
|
||||
|
||||
val wrapBefore = exactly4Contents && contentIndex == 3
|
||||
val fileSize = content.fileSize.toLong()
|
||||
val timestamp = content.creationTimestamp
|
||||
val fileModel = FileModel(
|
||||
|
|
@ -496,7 +499,8 @@ class MessageModel
|
|||
timestamp,
|
||||
isFileEncrypted,
|
||||
path,
|
||||
chatMessage.isEphemeral
|
||||
chatMessage.isEphemeral,
|
||||
flexboxLayoutWrapBefore = wrapBefore
|
||||
) { model ->
|
||||
onContentClicked?.invoke(model)
|
||||
}
|
||||
|
|
@ -509,7 +513,8 @@ class MessageModel
|
|||
isFileEncrypted,
|
||||
name,
|
||||
chatMessage.isEphemeral,
|
||||
isWaitingToBeDownloaded = true
|
||||
isWaitingToBeDownloaded = true,
|
||||
flexboxLayoutWrapBefore = wrapBefore
|
||||
) { model ->
|
||||
downloadContent(model, content)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue