-
Notifications
You must be signed in to change notification settings - Fork 768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emojis in code blocks crash #4795
Emojis in code blocks crash #4795
Conversation
- tentatively fixes IllegalArgumentException when recycling the text views due to AppCompatTextView.consumeTextFutureAndSetBlocking attempting to consuming any futures, even if they may be invalid
…tempt to enforce correct setText usage
|
||
@EpoxyAttribute | ||
var editedSpan: CharSequence? = null | ||
|
||
override fun bind(holder: Holder) { | ||
super.bind(holder) | ||
holder.messageView.text = message | ||
holder.messageView.setVectorText(message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the fix for the crash in the code blocks (applying the same emoji fix we're using for the other message types)
@@ -24,20 +24,22 @@ import im.vector.app.EmojiSpanify | |||
import im.vector.app.features.home.room.detail.timeline.item.BindingOptions | |||
import javax.inject.Inject | |||
|
|||
class SpanUtils @Inject constructor( | |||
data class VectorCharSequence(val value: CharSequence, val bindingOptions: BindingOptions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could potentially override the hashcode/equals here to avoid epoxy throwing when spannables mutate but I chose to leave out the change from this PR to setup the groundwork instead
Probably have to be updated now that #4837 has been merged |
b5ce8dc
to
6380ee9
Compare
going to close this PR, we're only using text futures in the message item and #4837 fixes the crash |
Depends on #4790, Fixes #4794 Room crash when viewing/submitting emojis in code blocks (requires markdown to be enabled)
VectorCharSequence
to contain the binding options and remove duplication when applying thesetText
logic