From 2a72437d28e55ff1244e79244402b4cb8c22e97c Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 10 Mar 2026 20:49:15 +0300 Subject: [PATCH] feat(android): add inline voice mini-player in chat info tab --- .../messenger/ui/chat/ChatScreen.kt | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/android/app/src/main/java/ru/daemonlord/messenger/ui/chat/ChatScreen.kt b/android/app/src/main/java/ru/daemonlord/messenger/ui/chat/ChatScreen.kt index 440e7c1..5314920 100644 --- a/android/app/src/main/java/ru/daemonlord/messenger/ui/chat/ChatScreen.kt +++ b/android/app/src/main/java/ru/daemonlord/messenger/ui/chat/ChatScreen.kt @@ -2949,6 +2949,73 @@ private fun ChatInfoTabContent( } return } + if (tab == ChatInfoTab.Voice) { + LazyColumn( + modifier = Modifier + .fillMaxWidth() + .height(320.dp), + verticalArrangement = Arrangement.spacedBy(8.dp), + ) { + items(filtered.take(60)) { entry -> + Column( + modifier = Modifier + .fillMaxWidth() + .clip(RoundedCornerShape(12.dp)) + .background(MaterialTheme.colorScheme.surface.copy(alpha = 0.55f)) + .padding(horizontal = 10.dp, vertical = 9.dp), + verticalArrangement = Arrangement.spacedBy(8.dp), + ) { + Row( + modifier = Modifier.fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(10.dp), + ) { + Box( + modifier = Modifier + .size(46.dp) + .clip(RoundedCornerShape(8.dp)) + .background(MaterialTheme.colorScheme.primaryContainer), + contentAlignment = Alignment.Center, + ) { + Icon( + imageVector = Icons.Filled.Mic, + contentDescription = null, + tint = MaterialTheme.colorScheme.onPrimaryContainer, + ) + } + Column(modifier = Modifier.weight(1f)) { + Text( + text = entry.title, + style = MaterialTheme.typography.bodyMedium, + fontWeight = FontWeight.SemiBold, + maxLines = 1, + ) + Text( + text = entry.subtitle, + style = MaterialTheme.typography.bodySmall, + color = MaterialTheme.colorScheme.onSurfaceVariant, + maxLines = 2, + ) + } + } + if (!entry.resourceUrl.isNullOrBlank()) { + AudioAttachmentPlayer( + url = entry.resourceUrl, + waveform = null, + isVoice = true, + playbackTitle = entry.title, + playbackSubtitle = entry.subtitle, + messageId = entry.sourceMessageId ?: entry.title.hashCode().toLong(), + onPlaybackChanged = {}, + forceStopAudioSourceId = null, + onForceStopAudioSourceHandled = {}, + ) + } + } + } + } + return + } LazyColumn( modifier = Modifier .fillMaxWidth()