Merge pull request #1004 from permissionlesstech/claude/bubble-audio-contrast-light-de2b64

Improve voice note waveform contrast in light mode
This commit is contained in:
callebtc 2026-10-25 23:01:59 +01:00 committed by GitHub
commit de26ef336b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View File

@ -111,7 +111,7 @@ fun VoiceNotePlayer(
onSeek = seekTo
)
val durText = if (durationMs > 0) String.format("%02d:%02d", (durationMs / 1000) / 60, (durationMs / 1000) % 60) else "--:--"
Text(text = durText, fontFamily = BitchatFontFamily, fontSize = 12.sp)
Text(text = durText, fontFamily = BitchatFontFamily, fontSize = 12.sp, color = MaterialTheme.colorScheme.onSurface)
}
}

View File

@ -2,6 +2,7 @@ package com.bitchat.android.ui.media
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.snapshots.SnapshotStateList
@ -50,6 +51,10 @@ fun WaveformPreview(
path: String,
sendProgress: Float?,
playbackProgress: Float?,
// Unplayed bars follow the surrounding text colour so they read on any bubble tint or
// surface; the played portion uses the theme accent, which is tuned per light/dark scheme.
baseColor: Color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.35f),
playedColor: Color = MaterialTheme.colorScheme.primary,
onLoaded: ((FloatArray) -> Unit)? = null,
onSeek: ((Float) -> Unit)? = null
) {
@ -74,10 +79,10 @@ fun WaveformPreview(
modifier = modifier,
samples = stateSamples,
fillProgress = if (stateSamples.isEmpty()) 0f else progress,
baseColor = Color(0x2200FF7F),
baseColor = baseColor,
fillColor = when {
sendProgress != null -> Color(0xFF1E88E5) // blue while sending
else -> Color(0xFF00C851) // green during playback
else -> playedColor
},
onSeek = onSeek
)