fix: messages dont edit in real time

Signed-off-by: Infi <wingit@geist.ga>
This commit is contained in:
Infi 2023-06-18 16:13:48 +02:00
parent 6a520eb138
commit 083e1d52be
1 changed files with 13 additions and 9 deletions

View File

@ -264,17 +264,21 @@ fun Message(
message.content?.let {
if (message.content.isBlank()) return@let // if only an attachment is sent
AndroidView(factory = { ctx ->
androidx.appcompat.widget.AppCompatTextView(ctx).apply {
text = parse(message)
maxLines = if (truncate) 1 else Int.MAX_VALUE
ellipsize = TextUtils.TruncateAt.END
textSize = 16f
typeface = ResourcesCompat.getFont(ctx, R.font.inter)
AndroidView(
factory = { ctx ->
androidx.appcompat.widget.AppCompatTextView(ctx).apply {
maxLines = if (truncate) 1 else Int.MAX_VALUE
ellipsize = TextUtils.TruncateAt.END
textSize = 16f
typeface = ResourcesCompat.getFont(ctx, R.font.inter)
setTextColor(contentColor.toArgb())
setTextColor(contentColor.toArgb())
}
},
update = {
it.text = parse(message)
}
})
)
}
message.attachments?.let {