-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Support Scheduled Send for Recorded Audio #13957
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
Conversation
I like this idea, but I think the UX could be improved. As-written, the app is actually still recording while you're picking the scheduled time. That could be a non-trivial amount of awkward silence at the end :) I think we could fix it though by stopping recording when the user long-presses the send button. When the long-press goes through, we could stop the recording at render it like we render voice note drafts (to see it, lock the recorder, then leave the chat and come back -- it's a special UI that shows a pending voice note). That way the recording is finalized when you're picking the time. |
cb0ae30
to
722d706
Compare
@@ -3956,6 +3963,10 @@ class ConversationFragment : | |||
} | |||
|
|||
override fun onSendScheduled() { | |||
if(inputPanel.isRecordingInLockedMode) { | |||
inputPanel.onSaveRecordDraft() |
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.
I could have used the inputPanel.onPause()
call, which calls the cancelAction
which then calls the onRecorderCanceled
with byUser = false
, which saves the audio draft and gives same results.
But, I decided to use new functions inputPanel.onSaveRecordDraft
, onRecorderSaved
, etc. so that these will make sense with the call site and anyone who has not worked in this flow can easily understand what is going on by just the function names.
What would you generally recommend? @greyson-signal
Some code duplicacy but more sensible names. Like I have created onSaveRecordDraft
which works exactly same as onRecordCanceled(false)
or
Less Easy to understand code with no duplicacy? Like calling the inputPanel.onPause()
to save audio draft, or calling onRecordCanceled(false)
to save audio draft.
I believe, a good code is self-explanatory with no need for documenting every function.
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.
I think having the names describe the action that's happening, even if the bodies are identical, is probably for the best. So I think what you have here is good 👍
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.
This is fantastic, thank you! It'll go out in 7.38
@@ -3956,6 +3963,10 @@ class ConversationFragment : | |||
} | |||
|
|||
override fun onSendScheduled() { | |||
if(inputPanel.isRecordingInLockedMode) { | |||
inputPanel.onSaveRecordDraft() |
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.
I think having the names describe the action that's happening, even if the bodies are identical, is probably for the best. So I think what you have here is good 👍
First time contributor checklist
Contributor checklist
Fixes #1234
syntaxDescription
2., Lock the Recorder