-
Notifications
You must be signed in to change notification settings - Fork 754
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
Bump io.element.android:wysiwyg from 2.14.1 to 2.22.0 #8711
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ import im.vector.app.features.home.room.detail.timeline.url.PreviewUrlUiState | |
import im.vector.app.features.home.room.detail.timeline.url.PreviewUrlView | ||
import im.vector.app.features.media.ImageContentRenderer | ||
import im.vector.lib.core.utils.epoxy.charsequence.EpoxyCharSequence | ||
import io.element.android.wysiwyg.EditorStyledTextView | ||
import io.noties.markwon.MarkwonPlugin | ||
import org.matrix.android.sdk.api.extensions.orFalse | ||
|
||
|
@@ -138,13 +139,19 @@ 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) | ||
var richMessageView: AppCompatTextView? = null | ||
var richMessageView: EditorStyledTextView? = null | ||
private set | ||
var plainMessageView: AppCompatTextView? = null | ||
private set | ||
|
||
fun requireRichMessageView(): AppCompatTextView { | ||
val view = richMessageView ?: richMessageStub.inflate().findViewById(R.id.messageTextView) | ||
val view = richMessageView ?: richMessageStub.inflate().findViewById<EditorStyledTextView>(R.id.messageTextView).also { | ||
// Required to ensure that `inlineCodeBgHelper` and `codeBlockBgHelper` are initialized | ||
it.updateStyle( | ||
styleConfig = it.styleConfig, | ||
mentionDisplayHandler = null, | ||
) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jmartinesp let me know what you think about this fix. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a bit weird, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this seems to be the case. It's alright then. Maybe in the next RTE version we can change it so it's done as soon as it's instantiated. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have put a breakpoint in |
||
richMessageView = view | ||
return view | ||
} | ||
|
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.
mentionDisplayHandler
is now private, so usingupdateStyle
with existingstyleConfig
for the first parameter. There is maybe another way to setmentionDisplayHandler
?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 right way to do it now. We did this to minimize the number of times we need to re-create the underlying
HtmlToSpanConverter
, specially in Compose.