mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 08:15:02 +00:00
Konsist: check if sealed class could be sealed interface and fix existing issues.
This commit is contained in:
committed by
Benoit Marty
parent
ddc1e1d0cc
commit
3092ca23f0
+4
-4
@@ -19,11 +19,11 @@ package io.element.android.libraries.voicerecorder.api
|
||||
import java.io.File
|
||||
import kotlin.time.Duration
|
||||
|
||||
sealed class VoiceRecorderState {
|
||||
sealed interface VoiceRecorderState {
|
||||
/**
|
||||
* The recorder is idle and not recording.
|
||||
*/
|
||||
data object Idle : VoiceRecorderState()
|
||||
data object Idle : VoiceRecorderState
|
||||
|
||||
/**
|
||||
* The recorder is currently recording.
|
||||
@@ -31,7 +31,7 @@ sealed class VoiceRecorderState {
|
||||
* @property elapsedTime The elapsed time since the recording started.
|
||||
* @property levels The current audio levels of the recording as a fraction of 1.
|
||||
*/
|
||||
data class Recording(val elapsedTime: Duration, val levels: List<Float>) : VoiceRecorderState()
|
||||
data class Recording(val elapsedTime: Duration, val levels: List<Float>) : VoiceRecorderState
|
||||
|
||||
/**
|
||||
* The recorder has finished recording.
|
||||
@@ -46,5 +46,5 @@ sealed class VoiceRecorderState {
|
||||
val mimeType: String,
|
||||
val waveform: List<Float>,
|
||||
val duration: Duration,
|
||||
) : VoiceRecorderState()
|
||||
) : VoiceRecorderState
|
||||
}
|
||||
|
||||
+3
-3
@@ -16,13 +16,13 @@
|
||||
|
||||
package io.element.android.libraries.voicerecorder.impl.audio
|
||||
|
||||
sealed class Audio {
|
||||
sealed interface Audio {
|
||||
class Data(
|
||||
val readSize: Int,
|
||||
val buffer: ShortArray,
|
||||
) : Audio()
|
||||
) : Audio
|
||||
|
||||
data class Error(
|
||||
val audioRecordErrorCode: Int
|
||||
) : Audio()
|
||||
) : Audio
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user