@ -129,7 +129,8 @@ private fun VoiceBubble(message: Message, textColor: Color,
/* Waveform with seek on tap */
if ( wfCount >= 2 ) {
Canvas ( modifier = Modifier . weight ( 1f ) . height ( 28. dp )
Box (
modifier = Modifier . weight ( 1f ) . height ( 28. dp )
. pointerInput ( message . filePath ) {
detectTapGestures { offset ->
if ( message . filePath . isEmpty ( ) ) return @detectTapGestures
@ -140,9 +141,10 @@ private fun VoiceBubble(message: Message, textColor: Color,
}
}
) {
Canvas ( modifier = Modifier . fillMaxSize ( ) ) {
val barW = size . width / wfCount
val ph = size . height
val showCursor = playing && ! paused
val showCursor = playing || paused
val playedIdx = if ( showCursor && progress > 0f ) ( progress * wfCount ) . toInt ( ) else 0
for ( i in 0 until wfCount ) {
val level = wf [ i ] . coerceIn ( 0f , 1f )
@ -163,6 +165,7 @@ private fun VoiceBubble(message: Message, textColor: Color,
}
}
}
}
Spacer ( Modifier . height ( 4. dp ) )
@ -173,7 +176,7 @@ private fun VoiceBubble(message: Message, textColor: Color,
verticalAlignment = Alignment . Bottom
) {
Text (
if ( playing && ! paused ) " ${formatDurationMs(elapsedMs)} / ${formatDurationMs(durMs)} "
if ( playing || paused ) " ${formatDurationMs(elapsedMs)} / ${formatDurationMs(durMs)} "
else formatDurationMs ( durMs ) ,
fontSize = 12. sp ,
color = textColor . copy ( alpha = 0.55f )