mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 04:52:00 +03:00
Create a new list for sublist to fix stackoverflowerror.
This commit is contained in:
parent
3cc1951587
commit
966b3ce54a
1 changed files with 3 additions and 1 deletions
|
@ -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<FFT>().apply {
|
||||
addAll(visibleBarHeights.subList(visibleBarHeights.size - maxVisibleBarCount, visibleBarHeights.size))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue