diff --git a/vector/src/main/java/im/vector/app/features/voice/AudioWaveformView.kt b/vector/src/main/java/im/vector/app/features/voice/AudioWaveformView.kt index 32f30fe458..a4a4281575 100644 --- a/vector/src/main/java/im/vector/app/features/voice/AudioWaveformView.kt +++ b/vector/src/main/java/im/vector/app/features/voice/AudioWaveformView.kt @@ -156,7 +156,9 @@ class AudioWaveformView @JvmOverloads constructor( val barHeight = max(fft.value / MAX_FFT * (height - verticalPadding * 2), barMinHeight) visibleBarHeights.add(FFT(barHeight, fft.color)) if (visibleBarHeights.size > maxVisibleBarCount) { - visibleBarHeights = visibleBarHeights.subList(visibleBarHeights.size - maxVisibleBarCount, visibleBarHeights.size) + visibleBarHeights = mutableListOf().apply { + addAll(visibleBarHeights.subList(visibleBarHeights.size - maxVisibleBarCount, visibleBarHeights.size)) + } } } }