mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-30 19:04:54 +01:00
Hide trailing newlines in text messages
Change-Id: I4e11feeb28abd5f186691d6f61bdf65252b2db0d
This commit is contained in:
parent
3a47c1b438
commit
b212344ad9
@ -52,8 +52,15 @@ abstract class MessageTextItem : AbsMessageItem<MessageTextItem.Holder>() {
|
||||
if (searchForPills) {
|
||||
message?.findPillsAndProcess(coroutineScope) { it.bind(holder.messageView) }
|
||||
}
|
||||
var m = message
|
||||
if (m != null) {
|
||||
// Remove last trailing newline: looks especially bad in message bubble
|
||||
if (m.last() == '\n') {
|
||||
m = m.subSequence(0, m.length-1)
|
||||
}
|
||||
}
|
||||
val textFuture = PrecomputedTextCompat.getTextFuture(
|
||||
message ?: "",
|
||||
m ?: "",
|
||||
TextViewCompat.getTextMetricsParams(holder.messageView),
|
||||
null)
|
||||
holder.messageView.setTextFuture(textFuture)
|
||||
|
Loading…
x
Reference in New Issue
Block a user