adding back the beforeSetText logic for markwon integraton and adding a nullable check to avoid attempt to cast a null to non null

This commit is contained in:
Adam Brown 2022-01-06 09:28:08 +00:00
parent 6380ee9176
commit 22bab47dad

View File

@ -16,6 +16,7 @@
package im.vector.app.features.home.room.detail.timeline.item package im.vector.app.features.home.room.detail.timeline.item
import android.text.Spanned
import android.text.method.MovementMethod import android.text.method.MovementMethod
import androidx.appcompat.widget.AppCompatTextView import androidx.appcompat.widget.AppCompatTextView
import androidx.core.text.PrecomputedTextCompat import androidx.core.text.PrecomputedTextCompat
@ -91,6 +92,9 @@ abstract class MessageTextItem : AbsMessageItem<MessageTextItem.Holder>() {
it.bind(holder.messageView) it.bind(holder.messageView)
} }
} }
message?.charSequence.let { charSequence ->
markwonPlugins?.forEach { plugin -> plugin.beforeSetText(holder.messageView, charSequence as Spanned) }
}
super.bind(holder) super.bind(holder)
holder.messageView.movementMethod = movementMethod holder.messageView.movementMethod = movementMethod
renderSendState(holder.messageView, holder.messageView) renderSendState(holder.messageView, holder.messageView)