allowing nullable message content in order to reset the content when recycling and an item doesn't contain a message
This commit is contained in:
parent
0df07d0a1e
commit
6380ee9176
|
@ -96,13 +96,12 @@ abstract class MessageTextItem : AbsMessageItem<MessageTextItem.Holder>() {
|
|||
renderSendState(holder.messageView, holder.messageView)
|
||||
holder.messageView.onClick(attributes.itemClickListener)
|
||||
holder.messageView.onLongClickIgnoringLinks(attributes.itemLongClickListener)
|
||||
|
||||
message?.let { holder.messageView.setTextWithEmojiSupport(it.charSequence, bindingOptions) }
|
||||
holder.messageView.setTextWithEmojiSupport(message?.charSequence, bindingOptions)
|
||||
markwonPlugins?.forEach { plugin -> plugin.afterSetText(holder.messageView) }
|
||||
}
|
||||
|
||||
private fun AppCompatTextView.setTextWithEmojiSupport(message: CharSequence, bindingOptions: BindingOptions?) {
|
||||
if (bindingOptions?.canUseTextFuture.orFalse()) {
|
||||
private fun AppCompatTextView.setTextWithEmojiSupport(message: CharSequence?, bindingOptions: BindingOptions?) {
|
||||
if (bindingOptions?.canUseTextFuture.orFalse() && message != null) {
|
||||
val textFuture = PrecomputedTextCompat.getTextFuture(message, TextViewCompat.getTextMetricsParams(this), null)
|
||||
setTextFuture(textFuture)
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue