Merge pull request #8743 from element-hq/feature/bma/editorIssue
Fix Rich Text Editor issues: save formatted text in draft and keep formatting when switching between modes
This commit is contained in:
commit
22f69ec6b0
|
@ -0,0 +1 @@
|
||||||
|
Restore formatting when restoring a draft. Also keep formatting when switching composer mode.
|
|
@ -47,6 +47,7 @@ import com.vanniktech.emoji.EmojiPopup
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
import im.vector.app.R
|
import im.vector.app.R
|
||||||
import im.vector.app.core.error.fatalError
|
import im.vector.app.core.error.fatalError
|
||||||
|
import im.vector.app.core.extensions.orEmpty
|
||||||
import im.vector.app.core.extensions.registerStartForActivityResult
|
import im.vector.app.core.extensions.registerStartForActivityResult
|
||||||
import im.vector.app.core.extensions.showKeyboard
|
import im.vector.app.core.extensions.showKeyboard
|
||||||
import im.vector.app.core.glide.GlideApp
|
import im.vector.app.core.glide.GlideApp
|
||||||
|
@ -255,7 +256,7 @@ class MessageComposerFragment : VectorBaseFragment<FragmentComposerBinding>(), A
|
||||||
it.isRecordingVoiceBroadcast && !requireActivity().isChangingConfigurations -> timelineViewModel.handle(VoiceBroadcastAction.Recording.Pause)
|
it.isRecordingVoiceBroadcast && !requireActivity().isChangingConfigurations -> timelineViewModel.handle(VoiceBroadcastAction.Recording.Pause)
|
||||||
else -> {
|
else -> {
|
||||||
timelineViewModel.handle(VoiceBroadcastAction.Listening.Pause)
|
timelineViewModel.handle(VoiceBroadcastAction.Listening.Pause)
|
||||||
messageComposerViewModel.handle(MessageComposerAction.OnEntersBackground(composer.text.toString()))
|
messageComposerViewModel.handle(MessageComposerAction.OnEntersBackground(composer.formattedText ?: composer.text.orEmpty().toString()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -403,7 +404,7 @@ class MessageComposerFragment : VectorBaseFragment<FragmentComposerBinding>(), A
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onTextChanged(text: CharSequence) {
|
override fun onTextChanged(text: CharSequence) {
|
||||||
messageComposerViewModel.handle(MessageComposerAction.OnTextChanged(text))
|
messageComposerViewModel.handle(MessageComposerAction.OnTextChanged(composer.formattedText ?: text))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFullScreenModeChanged() = withState(messageComposerViewModel) { state ->
|
override fun onFullScreenModeChanged() = withState(messageComposerViewModel) { state ->
|
||||||
|
|
Loading…
Reference in New Issue