Fix issue with timeline message view reuse while rich text editor is enabled (#8688)
This commit is contained in:
parent
fd5530a2f9
commit
63ef40f58b
|
@ -0,0 +1 @@
|
|||
Fix issue with timeline message view reuse while rich text editor is enabled
|
|
@ -85,8 +85,13 @@ abstract class MessageTextItem : AbsMessageItem<MessageTextItem.Holder>() {
|
|||
}
|
||||
holder.previewUrlView.delegate = previewUrlCallback
|
||||
holder.previewUrlView.renderMessageLayout(attributes.informationData.messageLayout)
|
||||
|
||||
val messageView: AppCompatTextView = if (useRichTextEditorStyle) holder.richMessageView else holder.plainMessageView
|
||||
if (useRichTextEditorStyle) {
|
||||
holder.plainMessageView?.isVisible = false
|
||||
} else {
|
||||
holder.richMessageView?.isVisible = false
|
||||
}
|
||||
val messageView: AppCompatTextView = if (useRichTextEditorStyle) holder.requireRichMessageView() else holder.requirePlainMessageView()
|
||||
messageView.isVisible = true
|
||||
if (useBigFont) {
|
||||
messageView.textSize = 44F
|
||||
} else {
|
||||
|
@ -133,11 +138,21 @@ abstract class MessageTextItem : AbsMessageItem<MessageTextItem.Holder>() {
|
|||
val previewUrlView by bind<PreviewUrlView>(R.id.messageUrlPreview)
|
||||
private val richMessageStub by bind<ViewStub>(R.id.richMessageTextViewStub)
|
||||
private val plainMessageStub by bind<ViewStub>(R.id.plainMessageTextViewStub)
|
||||
val richMessageView: AppCompatTextView by lazy {
|
||||
richMessageStub.inflate().findViewById(R.id.messageTextView)
|
||||
var richMessageView: AppCompatTextView? = null
|
||||
private set
|
||||
var plainMessageView: AppCompatTextView? = null
|
||||
private set
|
||||
|
||||
fun requireRichMessageView(): AppCompatTextView {
|
||||
val view = richMessageView ?: richMessageStub.inflate().findViewById(R.id.messageTextView)
|
||||
richMessageView = view
|
||||
return view
|
||||
}
|
||||
val plainMessageView: AppCompatTextView by lazy {
|
||||
plainMessageStub.inflate().findViewById(R.id.messageTextView)
|
||||
|
||||
fun requirePlainMessageView(): AppCompatTextView {
|
||||
val view = plainMessageView ?: plainMessageStub.inflate().findViewById(R.id.messageTextView)
|
||||
plainMessageView = view
|
||||
return view
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue