mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 01:45:52 +03:00
Fix concurrent modification crash.
This commit is contained in:
parent
c57ae131dc
commit
d7174d3c74
1 changed files with 7 additions and 7 deletions
|
@ -326,11 +326,11 @@ class VoiceMessageRecorderView @JvmOverloads constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private fun renderRecordingWaveform(amplitudeList: List<Int>) {
|
||||
views.voicePlaybackWaveform.apply {
|
||||
post {
|
||||
amplitudeList.forEach { amplitude ->
|
||||
update(amplitude)
|
||||
private fun renderRecordingWaveform(amplitudeList: Array<Int>) {
|
||||
post {
|
||||
views.voicePlaybackWaveform.apply {
|
||||
amplitudeList.iterator().forEach {
|
||||
update(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -404,7 +404,7 @@ class VoiceMessageRecorderView @JvmOverloads constructor(
|
|||
scaleX = 1f
|
||||
scaleY = 1f
|
||||
translationX = 0f
|
||||
translationY = 0f
|
||||
translationY = 0f
|
||||
}
|
||||
isCancelled?.let {
|
||||
callback?.onVoiceRecordingEnded(it)
|
||||
|
@ -503,7 +503,7 @@ class VoiceMessageRecorderView @JvmOverloads constructor(
|
|||
override fun onUpdate(state: VoiceMessagePlaybackTracker.Listener.State) {
|
||||
when (state) {
|
||||
is VoiceMessagePlaybackTracker.Listener.State.Recording -> {
|
||||
renderRecordingWaveform(state.amplitudeList)
|
||||
renderRecordingWaveform(state.amplitudeList.toTypedArray())
|
||||
}
|
||||
is VoiceMessagePlaybackTracker.Listener.State.Playing -> {
|
||||
views.voicePlaybackControlButton.setImageResource(R.drawable.ic_play_pause_pause)
|
||||
|
|
Loading…
Reference in a new issue