Skip to content

Commit 5bdceb9

Browse files
committed
suggestions
Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
1 parent bcdfcc3 commit 5bdceb9

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

app/src/main/java/com/nextcloud/talk/ui/chat/VoiceMessage.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ fun VoiceMessage(
6868
val remainingSeconds = (typeContent.durationSeconds - typeContent.playedSeconds).coerceAtLeast(0)
6969
val waveformData = remember(typeContent.waveform) {
7070
val floatArr = typeContent.waveform.toFloatArray()
71-
AudioUtils.shrinkFloatArray(floatArr, WAVEFORM_SIZE)
71+
if (floatArr.size < WAVEFORM_SIZE) {
72+
FloatArray(WAVEFORM_SIZE)
73+
} else {
74+
AudioUtils.shrinkFloatArray(floatArr, WAVEFORM_SIZE)
75+
}
7276
}
7377

7478
Column {
@@ -99,7 +103,6 @@ fun VoiceMessage(
99103
{
100104
val progressI = (it * SEEKBAR_MAX).toInt()
101105
onSeek(message.id, progressI)
102-
sliderValue = it
103106
},
104107
modifier = Modifier
105108
.height(56.dp)

0 commit comments

Comments
 (0)