From 07d4c546ef85c3339301c5d8e05f2e58dd2e3938 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 25 Oct 2026 14:32:09 +0100 Subject: [PATCH] Improve voice note waveform contrast in light mode Draw unplayed waveform bars in the surface text colour and played bars in the theme accent, and give the duration label an explicit colour so it stays readable in dark mode. --- .../java/com/bitchat/android/ui/media/VoiceNotePlayer.kt | 2 +- .../java/com/bitchat/android/ui/media/WaveformViews.kt | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/bitchat/android/ui/media/VoiceNotePlayer.kt b/app/src/main/java/com/bitchat/android/ui/media/VoiceNotePlayer.kt index 1f3f567ed..131d1605b 100644 --- a/app/src/main/java/com/bitchat/android/ui/media/VoiceNotePlayer.kt +++ b/app/src/main/java/com/bitchat/android/ui/media/VoiceNotePlayer.kt @@ -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) } } diff --git a/app/src/main/java/com/bitchat/android/ui/media/WaveformViews.kt b/app/src/main/java/com/bitchat/android/ui/media/WaveformViews.kt index 64261d47a..8c598a62a 100644 --- a/app/src/main/java/com/bitchat/android/ui/media/WaveformViews.kt +++ b/app/src/main/java/com/bitchat/android/ui/media/WaveformViews.kt @@ -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 )