diff --git a/client-mobile/.gradle/8.5/executionHistory/executionHistory.bin b/client-mobile/.gradle/8.5/executionHistory/executionHistory.bin index 96fbddb..9599610 100644 Binary files a/client-mobile/.gradle/8.5/executionHistory/executionHistory.bin and b/client-mobile/.gradle/8.5/executionHistory/executionHistory.bin differ diff --git a/client-mobile/.gradle/8.5/executionHistory/executionHistory.lock b/client-mobile/.gradle/8.5/executionHistory/executionHistory.lock index 3499052..0719227 100644 Binary files a/client-mobile/.gradle/8.5/executionHistory/executionHistory.lock and b/client-mobile/.gradle/8.5/executionHistory/executionHistory.lock differ diff --git a/client-mobile/.gradle/8.5/fileHashes/fileHashes.bin b/client-mobile/.gradle/8.5/fileHashes/fileHashes.bin index e2f5b50..cf668aa 100644 Binary files a/client-mobile/.gradle/8.5/fileHashes/fileHashes.bin and b/client-mobile/.gradle/8.5/fileHashes/fileHashes.bin differ diff --git a/client-mobile/.gradle/8.5/fileHashes/fileHashes.lock b/client-mobile/.gradle/8.5/fileHashes/fileHashes.lock index 67f399e..a89b87f 100644 Binary files a/client-mobile/.gradle/8.5/fileHashes/fileHashes.lock and b/client-mobile/.gradle/8.5/fileHashes/fileHashes.lock differ diff --git a/client-mobile/.gradle/8.5/fileHashes/resourceHashesCache.bin b/client-mobile/.gradle/8.5/fileHashes/resourceHashesCache.bin index aa72534..6bf986b 100644 Binary files a/client-mobile/.gradle/8.5/fileHashes/resourceHashesCache.bin and b/client-mobile/.gradle/8.5/fileHashes/resourceHashesCache.bin differ diff --git a/client-mobile/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/client-mobile/.gradle/buildOutputCleanup/buildOutputCleanup.lock index ccbd187..87092d5 100644 Binary files a/client-mobile/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/client-mobile/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/client-mobile/.gradle/buildOutputCleanup/outputFiles.bin b/client-mobile/.gradle/buildOutputCleanup/outputFiles.bin index cf8f8f1..2c10606 100644 Binary files a/client-mobile/.gradle/buildOutputCleanup/outputFiles.bin and b/client-mobile/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/client-mobile/chats/presentation/chat_detail/ChatDetailScreen.kt b/client-mobile/chats/presentation/chat_detail/ChatDetailScreen.kt index 4c08912..a8896fd 100644 --- a/client-mobile/chats/presentation/chat_detail/ChatDetailScreen.kt +++ b/client-mobile/chats/presentation/chat_detail/ChatDetailScreen.kt @@ -47,7 +47,10 @@ import android.Manifest import android.content.pm.PackageManager import androidx.core.content.ContextCompat import androidx.compose.ui.draw.clip +import androidx.compose.foundation.border +import androidx.compose.foundation.clickable import androidx.compose.foundation.shape.CircleShape +import androidx.compose.ui.draw.shadow import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.BasicTextField import androidx.compose.ui.unit.sp @@ -70,6 +73,7 @@ fun ChatDetailScreen( val context = LocalContext.current val listState = rememberLazyListState() val scope = rememberCoroutineScope() + val voiceRecorder = remember { VoiceRecorder(context) } var isEmojiPickerVisible by remember { mutableStateOf(false) } var isRecording by remember { mutableStateOf(false) } @@ -179,15 +183,11 @@ fun ChatDetailScreen( // Показывать ли кнопку "вниз" // Она должна появляться если мы не в самом низу + // Проверка видимости кнопки скролла вниз val showScrollToBottom by remember { - derivedStateOf { - val layoutInfo = listState.layoutInfo - if (layoutInfo.totalItemsCount == 0) return@derivedStateOf false - - val lastVisibleIndex = layoutInfo.visibleItemsInfo.lastOrNull()?.index ?: 0 - // Показываем, если не в самом низу (с запасом 1-2 элемента) - lastVisibleIndex < listItems.size - 2 - } + derivedStateOf { + listState.firstVisibleItemIndex > 5 + } } // 4. Авто-скролл к новым сообщениям @@ -420,19 +420,26 @@ fun ChatDetailScreen( .align(Alignment.BottomEnd) .padding(bottom = 16.dp, end = 16.dp) ) { - FloatingActionButton( - onClick = { - scope.launch { - listState.animateScrollToItem(listItems.size - 1) - } - }, - containerColor = MaterialTheme.colorScheme.surface, - contentColor = MaterialTheme.colorScheme.primary, - shape = CircleShape, - modifier = Modifier.size(44.dp), - elevation = FloatingActionButtonDefaults.elevation(2.dp) + Box( + modifier = Modifier + .size(44.dp) + .shadow(8.dp, CircleShape) + .clip(CircleShape) + .background(MaterialTheme.colorScheme.surface.copy(alpha = 0.6f)) + .border(0.5.dp, Color.White.copy(alpha = 0.3f), CircleShape) + .clickable { + scope.launch { + listState.animateScrollToItem(0) + } + }, + contentAlignment = Alignment.Center ) { - Icon(Icons.Default.KeyboardArrowDown, contentDescription = null) + Icon( + Icons.Default.KeyboardArrowDown, + contentDescription = null, + tint = MaterialTheme.colorScheme.primary, + modifier = Modifier.size(28.dp) + ) } if (unreadCount > 0) {