mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-26 03:16:02 +03:00
Code review fix.
This commit is contained in:
parent
807e89521f
commit
0b9db0ee6b
1 changed files with 3 additions and 3 deletions
|
@ -151,14 +151,14 @@ class AudioWaveformView @JvmOverloads constructor(
|
|||
|
||||
private fun handleNewFftList(fftList: List<FFT>) {
|
||||
val maxVisibleBarCount = getMaxVisibleBarCount()
|
||||
|
||||
fftList.forEach { fft ->
|
||||
rawFftList.add(fft)
|
||||
val barHeight = max(fft.value / MAX_FFT * (height - verticalPadding * 2), barMinHeight)
|
||||
visibleBarHeights.add(FFT(barHeight, fft.color))
|
||||
|
||||
if (visibleBarHeights.size > maxVisibleBarCount) {
|
||||
visibleBarHeights = mutableListOf<FFT>().apply {
|
||||
addAll(visibleBarHeights.subList(visibleBarHeights.size - maxVisibleBarCount, visibleBarHeights.size))
|
||||
}
|
||||
visibleBarHeights = visibleBarHeights.takeLast(maxVisibleBarCount).toMutableList()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue