mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-11-08 08:01:09 +00:00
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:
commit
de26ef336b
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user