Konsist: check if sealed class could be sealed interface and fix existing issues.

This commit is contained in:
Benoit Marty 2023-11-02 15:16:32 +01:00 committed by Benoit Marty
parent 413ec4b5db
commit c5f3562454
14 changed files with 66 additions and 55 deletions

View file

@ -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
}