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) {
|
private fun insertMatrixItemIntoRichTextEditor(editorEditText: EditorEditText, matrixItem: MatrixItem) {
|
||||||
if (matrixItem is MatrixItem.EveryoneInRoomItem) {
|
if (matrixItem is MatrixItem.EveryoneInRoomItem) {
|
||||||
editorEditText.replaceTextSuggestion(matrixItem.displayName)
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,7 +254,7 @@ class AutoCompleter @AssistedInject constructor(
|
||||||
matrixItem.getBestName()
|
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) {
|
private fun insertMatrixItemIntoEditable(editText: EditText, editable: Editable, firstChar: Char, matrixItem: MatrixItem) {
|
||||||
|
|
|
@ -105,10 +105,10 @@ internal class RichTextComposerLayout @JvmOverloads constructor(
|
||||||
override val attachmentButton: ImageButton
|
override val attachmentButton: ImageButton
|
||||||
get() = views.attachmentButton
|
get() = views.attachmentButton
|
||||||
|
|
||||||
val richTextEditText: EditText get() =
|
val richTextEditText: EditText
|
||||||
views.richTextComposerEditText
|
get() = views.richTextComposerEditText
|
||||||
val plainTextEditText: EditText get() =
|
val plainTextEditText: EditText
|
||||||
views.plainTextComposerEditText
|
get() = views.plainTextComposerEditText
|
||||||
|
|
||||||
var pillDisplayHandler: PillDisplayHandler? = null
|
var pillDisplayHandler: PillDisplayHandler? = null
|
||||||
|
|
||||||
|
@ -237,14 +237,16 @@ internal class RichTextComposerLayout @JvmOverloads constructor(
|
||||||
views.composerEditTextOuterBorder.background = borderShapeDrawable
|
views.composerEditTextOuterBorder.background = borderShapeDrawable
|
||||||
|
|
||||||
setupRichTextMenu()
|
setupRichTextMenu()
|
||||||
views.richTextComposerEditText.mentionDisplayHandler = object : MentionDisplayHandler {
|
views.richTextComposerEditText.updateStyle(
|
||||||
override fun resolveMentionDisplay(text: String, url: String): TextDisplay =
|
styleConfig = views.richTextComposerEditText.styleConfig,
|
||||||
pillDisplayHandler?.resolveMentionDisplay(text, url) ?: TextDisplay.Plain
|
mentionDisplayHandler = object : MentionDisplayHandler {
|
||||||
|
override fun resolveMentionDisplay(text: String, url: String): TextDisplay =
|
||||||
override fun resolveAtRoomMentionDisplay(): TextDisplay =
|
pillDisplayHandler?.resolveMentionDisplay(text, url) ?: TextDisplay.Plain
|
||||||
pillDisplayHandler?.resolveAtRoomMentionDisplay() ?: TextDisplay.Plain
|
|
||||||
}
|
|
||||||
|
|
||||||
|
override fun resolveAtRoomMentionDisplay(): TextDisplay =
|
||||||
|
pillDisplayHandler?.resolveAtRoomMentionDisplay() ?: TextDisplay.Plain
|
||||||
|
}
|
||||||
|
)
|
||||||
updateTextFieldBorder(isFullScreen)
|
updateTextFieldBorder(isFullScreen)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue