removing no longer needed message delete on animation end, we delete the file straight away

This commit is contained in:
Adam Brown 2021-11-18 17:28:08 +00:00
parent 1afc1b51e5
commit 7d262ebc32
2 changed files with 2 additions and 4 deletions

View File

@ -131,7 +131,7 @@ class VoiceMessageRecorderView @JvmOverloads constructor(
}
RecordingUiState.Cancelled -> {
stopRecordingTicker()
voiceMessageViews.hideRecordingViews(recordingState) { callback.onDeleteVoiceMessage() }
voiceMessageViews.hideRecordingViews(recordingState)
vibrate(context)
}
RecordingUiState.Locked -> {

View File

@ -151,7 +151,7 @@ class VoiceMessageViews(
views.voiceMessageSendButton.isVisible = false
}
fun hideRecordingViews(recordingState: RecordingUiState, onVoiceRecordingEnded: () -> Unit = {}) {
fun hideRecordingViews(recordingState: RecordingUiState) {
// We need to animate the lock image first
if (recordingState != RecordingUiState.Locked) {
views.voiceMessageLockImage.isVisible = false
@ -180,7 +180,6 @@ class VoiceMessageViews(
.setDuration(150)
.withEndAction {
resetMicButtonUi()
onVoiceRecordingEnded()
}
.start()
} else {
@ -192,7 +191,6 @@ class VoiceMessageViews(
translationX = 0f
translationY = 0f
}
onVoiceRecordingEnded()
}
// Hide toasts if user cancelled recording before the timeout of the toast.