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.delegate = previewUrlCallback
|
||||||
holder.previewUrlView.renderMessageLayout(attributes.informationData.messageLayout)
|
holder.previewUrlView.renderMessageLayout(attributes.informationData.messageLayout)
|
||||||
|
if (useRichTextEditorStyle) {
|
||||||
val messageView: AppCompatTextView = if (useRichTextEditorStyle) holder.richMessageView else holder.plainMessageView
|
holder.plainMessageView?.isVisible = false
|
||||||
|
} else {
|
||||||
|
holder.richMessageView?.isVisible = false
|
||||||
|
}
|
||||||
|
val messageView: AppCompatTextView = if (useRichTextEditorStyle) holder.requireRichMessageView() else holder.requirePlainMessageView()
|
||||||
|
messageView.isVisible = true
|
||||||
if (useBigFont) {
|
if (useBigFont) {
|
||||||
messageView.textSize = 44F
|
messageView.textSize = 44F
|
||||||
} else {
|
} else {
|
||||||
|
@ -133,11 +138,21 @@ abstract class MessageTextItem : AbsMessageItem<MessageTextItem.Holder>() {
|
||||||
val previewUrlView by bind<PreviewUrlView>(R.id.messageUrlPreview)
|
val previewUrlView by bind<PreviewUrlView>(R.id.messageUrlPreview)
|
||||||
private val richMessageStub by bind<ViewStub>(R.id.richMessageTextViewStub)
|
private val richMessageStub by bind<ViewStub>(R.id.richMessageTextViewStub)
|
||||||
private val plainMessageStub by bind<ViewStub>(R.id.plainMessageTextViewStub)
|
private val plainMessageStub by bind<ViewStub>(R.id.plainMessageTextViewStub)
|
||||||
val richMessageView: AppCompatTextView by lazy {
|
var richMessageView: AppCompatTextView? = null
|
||||||
richMessageStub.inflate().findViewById(R.id.messageTextView)
|
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