Update initial recording state to restore from background.

This commit is contained in:
Onuray Sahin 2021-07-30 11:27:14 +03:00
parent e945b8911c
commit cfe64eed2a
1 changed files with 2 additions and 3 deletions

View File

@ -88,6 +88,8 @@ class VoiceMessageRecorderView @JvmOverloads constructor(
} }
fun initVoiceRecordingViews() { fun initVoiceRecordingViews() {
recordingState = RecordingState.NONE
hideRecordingViews(null) hideRecordingViews(null)
stopRecordingTicker() stopRecordingTicker()
@ -327,9 +329,6 @@ class VoiceMessageRecorderView @JvmOverloads constructor(
private fun renderRecordingWaveform(amplitudeList: List<Int>) { private fun renderRecordingWaveform(amplitudeList: List<Int>) {
views.voicePlaybackWaveform.apply { views.voicePlaybackWaveform.apply {
post { post {
// TODO We could avoid recreating the whole view here and just call update() with the new value(s).
// Currently it is broken if a configuration change occurs.
recreate()
amplitudeList.forEach { amplitude -> amplitudeList.forEach { amplitude ->
update(amplitude) update(amplitude)
} }