Add voice message recording duration indicator and limit (#1628)

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
jonnyandrew 2023-10-24 12:44:53 +01:00 committed by GitHub
parent 8c0d9cc6a0
commit f1b142f002
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 263 additions and 35 deletions

View file

@ -17,6 +17,7 @@
package io.element.android.libraries.voicerecorder.api
import java.io.File
import kotlin.time.Duration
sealed class VoiceRecorderState {
/**
@ -27,9 +28,10 @@ sealed class VoiceRecorderState {
/**
* The recorder is currently recording.
*
* @property elapsedTime The elapsed time since the recording started.
* @property level The current audio level of the recording as a fraction of 1.
*/
data class Recording(val level: Double) : VoiceRecorderState()
data class Recording(val elapsedTime: Duration, val level: Double) : VoiceRecorderState()
/**
* The recorder has finished recording.