mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-26 03:16:02 +03:00
Merge pull request #4742 from vector-im/feature/aris/fix_immutable_model_crash
Fix crash ImmutableModelException
This commit is contained in:
commit
461beda634
2 changed files with 4 additions and 1 deletions
1
changelog.d/4742.bugfix
Normal file
1
changelog.d/4742.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
Fix app crash uppon long press on a reply event
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package im.vector.app.features.home.room.detail.timeline.tools
|
||||
|
||||
import android.text.SpannableStringBuilder
|
||||
import android.text.style.ClickableSpan
|
||||
import android.view.MotionEvent
|
||||
import android.widget.TextView
|
||||
|
@ -44,7 +45,8 @@ fun CharSequence.findPillsAndProcess(scope: CoroutineScope, processBlock: (PillI
|
|||
|
||||
fun CharSequence.linkify(callback: TimelineEventController.UrlClickCallback?): CharSequence {
|
||||
val text = this.toString()
|
||||
val spannable = toSpannable()
|
||||
// SpannableStringBuilder is used to avoid Epoxy throwing ImmutableModelException
|
||||
val spannable = SpannableStringBuilder(this)
|
||||
MatrixLinkify.addLinks(spannable, object : MatrixPermalinkSpan.Callback {
|
||||
override fun onUrlClicked(url: String) {
|
||||
callback?.onUrlClicked(url, text)
|
||||
|
|
Loading…
Reference in a new issue