RTE: fix API break...
This commit is contained in:
parent
d145c3108d
commit
fac8dd333a
|
@ -232,6 +232,7 @@ class AutoCompleter @AssistedInject constructor(
|
|||
private fun insertMatrixItemIntoRichTextEditor(editorEditText: EditorEditText, matrixItem: MatrixItem) {
|
||||
if (matrixItem is MatrixItem.EveryoneInRoomItem) {
|
||||
editorEditText.replaceTextSuggestion(matrixItem.displayName)
|
||||
// Note: not using editorEditText.insertAtRoomMentionAtSuggestion() since we want to keep the existing look and feel of the mention for @room.
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -253,7 +254,7 @@ class AutoCompleter @AssistedInject constructor(
|
|||
matrixItem.getBestName()
|
||||
}
|
||||
|
||||
editorEditText.setLinkSuggestion(url = permalink, text = linkText)
|
||||
editorEditText.insertMentionAtSuggestion(url = permalink, text = linkText)
|
||||
}
|
||||
|
||||
private fun insertMatrixItemIntoEditable(editText: EditText, editable: Editable, firstChar: Char, matrixItem: MatrixItem) {
|
||||
|
|
|
@ -105,10 +105,10 @@ internal class RichTextComposerLayout @JvmOverloads constructor(
|
|||
override val attachmentButton: ImageButton
|
||||
get() = views.attachmentButton
|
||||
|
||||
val richTextEditText: EditText get() =
|
||||
views.richTextComposerEditText
|
||||
val plainTextEditText: EditText get() =
|
||||
views.plainTextComposerEditText
|
||||
val richTextEditText: EditText
|
||||
get() = views.richTextComposerEditText
|
||||
val plainTextEditText: EditText
|
||||
get() = views.plainTextComposerEditText
|
||||
|
||||
var pillDisplayHandler: PillDisplayHandler? = null
|
||||
|
||||
|
@ -237,14 +237,16 @@ internal class RichTextComposerLayout @JvmOverloads constructor(
|
|||
views.composerEditTextOuterBorder.background = borderShapeDrawable
|
||||
|
||||
setupRichTextMenu()
|
||||
views.richTextComposerEditText.mentionDisplayHandler = object : MentionDisplayHandler {
|
||||
views.richTextComposerEditText.updateStyle(
|
||||
styleConfig = views.richTextComposerEditText.styleConfig,
|
||||
mentionDisplayHandler = object : MentionDisplayHandler {
|
||||
override fun resolveMentionDisplay(text: String, url: String): TextDisplay =
|
||||
pillDisplayHandler?.resolveMentionDisplay(text, url) ?: TextDisplay.Plain
|
||||
|
||||
override fun resolveAtRoomMentionDisplay(): TextDisplay =
|
||||
pillDisplayHandler?.resolveAtRoomMentionDisplay() ?: TextDisplay.Plain
|
||||
}
|
||||
|
||||
)
|
||||
updateTextFieldBorder(isFullScreen)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue