Add waveform to voice message preview UI (#1661)

* Add waveform to preview UI

* Update screenshots

* Make random waveform function deterministic

* Update screenshots

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
jonnyandrew 2023-10-27 12:33:35 +01:00 committed by GitHub
parent 0bd9c78836
commit 38de57bb02
13 changed files with 157 additions and 67 deletions

View file

@ -42,6 +42,7 @@ class FakeVoiceRecorder(
private var stoppedCount = 0
private var deletedCount = 0
var waveform: List<Float> = listOf(0f, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f, 8f, 7f, 6f, 5f, 4f, 3f, 2f, 1f, 0f)
override suspend fun startRecord() {
startedCount += 1
val startedAt = timeSource.markNow()
@ -73,7 +74,7 @@ class FakeVoiceRecorder(
else -> VoiceRecorderState.Finished(
file = curRecording!!,
mimeType = "audio/ogg",
waveform = listOf(0f, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f, 8f, 7f, 6f, 5f, 4f, 3f, 2f, 1f, 0f),
waveform = waveform,
)
}
)