Detekt: fix ArrayPrimitive

This commit is contained in:
Benoit Marty 2022-05-12 17:54:15 +02:00
parent c3b5ba5639
commit f02bad5c79
2 changed files with 3 additions and 3 deletions

View File

@ -225,7 +225,7 @@ class VoiceMessageRecorderView @JvmOverloads constructor(
override fun onUpdate(state: AudioMessagePlaybackTracker.Listener.State) {
when (state) {
is AudioMessagePlaybackTracker.Listener.State.Recording -> {
voiceMessageViews.renderRecordingWaveform(state.amplitudeList.toTypedArray())
voiceMessageViews.renderRecordingWaveform(state.amplitudeList.toList())
}
is AudioMessagePlaybackTracker.Listener.State.Playing -> {
voiceMessageViews.renderPlaying(state)

View File

@ -345,10 +345,10 @@ class VoiceMessageViews(
}
}
fun renderRecordingWaveform(amplitudeList: Array<Int>) {
fun renderRecordingWaveform(amplitudeList: List<Int>) {
views.voicePlaybackWaveform.doOnLayout { waveFormView ->
val waveformColor = ThemeUtils.getColor(waveFormView.context, R.attr.vctr_content_quaternary)
amplitudeList.iterator().forEach {
amplitudeList.forEach {
(waveFormView as AudioWaveformView).add(AudioWaveformView.FFT(it.toFloat(), waveformColor))
}
}