-
Notifications
You must be signed in to change notification settings - Fork 742
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
Adding support for voice drafts #4558
Conversation
data class Quote(val linkedEventId: String, val content: String) : UserDraft | ||
data class Edit(val linkedEventId: String, val content: String) : UserDraft | ||
data class Reply(val linkedEventId: String, val content: String) : UserDraft | ||
data class Voice(val content: String) : UserDraft |
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.
Voice
has been added, the other diff changes are caused by text
being renamed to content
private fun handlePauseRecordingVoiceMessage() { | ||
voiceMessageHelper.pauseRecording() | ||
} | ||
|
||
private fun handleEntersBackground(composerText: String) { | ||
val isVoiceRecording = com.airbnb.mvrx.withState(this) { it.isVoiceRecording } |
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.
we want the synchronous state reading here as we need to act during onPause
and clear any view state (clearTracker) whilst on the main thread
if we do this async then we can end up removing the waveforms due to clearTracker
triggering after the reinitialising the views
- introduces a new Voice draft and sender mode type - initializes the voice recorder with a previously recorded file (the draft) - renames RecordingUiStates to map to their actual UI states
c69fa49
to
aaba628
Compare
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.
LGTM, thanks. I will do more test once merged on develop.
Fixes #3922 Continuation of @onurays #4237 rebased and squashed with all of the refactors around the
VoiceMessageRecorderView
andMessageComposerViewModel
refactors (and also #4527)UserDraft.Voice
andSendMode.Voice
in order to differentiate between audio messagesVoiceRecordingView
callbacks to have explicit actions instead of exposing internalRecordingUiStates