Use renderComposerMode (disable formattedContent which crashes)
This commit is contained in:
parent
13bbcc6e26
commit
2d54838e4f
2 changed files with 8 additions and 4 deletions
|
|
@ -485,11 +485,15 @@ class RichTextComposerLayout @JvmOverloads constructor(
|
|||
} else {
|
||||
views.composerModeGroup.isGone = true
|
||||
(mode as? MessageComposerMode.Normal)?.content?.let { text ->
|
||||
// TODO: un-comment once we update to a version of the lib > 0.8.0
|
||||
/*
|
||||
if (isTextFormattingEnabled) {
|
||||
replaceFormattedContent(text)
|
||||
} else {
|
||||
views.plainTextComposerEditText.setText(text)
|
||||
}
|
||||
*/
|
||||
views.plainTextComposerEditText.setText(text)
|
||||
}
|
||||
views.sendButton.contentDescription = resources.getString(ElementR.string.action_send)
|
||||
hasRelatedMessage = false
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ fun TextComposer(
|
|||
FakeComposer(modifier)
|
||||
return
|
||||
}
|
||||
|
||||
val isInDarkMode = isSystemInDarkTheme()
|
||||
AndroidView(
|
||||
modifier = modifier,
|
||||
|
|
@ -86,10 +87,10 @@ fun TextComposer(
|
|||
// Example of Compose -> View communication
|
||||
val messageComposerView = (view as MessageComposerView)
|
||||
view.setFullScreen(fullscreen, animated = false, manageKeyboard = false)
|
||||
// TODO: un-comment once we update to a version of the lib > 0.8.0
|
||||
// messageComposerView.renderComposerMode(composerMode)
|
||||
messageComposerView.renderComposerMode(composerMode)
|
||||
messageComposerView.sendButton.isInvisible = !composerCanSendMessage
|
||||
messageComposerView.setTextIfDifferent(composerText ?: "")
|
||||
messageComposerView.editText.requestFocus()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
@ -124,8 +125,7 @@ private fun MessageComposerView.setup(isDarkMode: Boolean, composerMode: Message
|
|||
emojiButton?.isVisible = true
|
||||
sendButton.isVisible = true
|
||||
editText.maxLines = MessageComposerView.MAX_LINES_WHEN_COLLAPSED
|
||||
// TODO: un-comment once we update to a version of the lib > 0.8.0
|
||||
// renderComposerMode(composerMode)
|
||||
renderComposerMode(composerMode)
|
||||
}
|
||||
|
||||
@Preview
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue