From 4d4130fefdb6dc08cee78e03c3d88ba22fc6b175 Mon Sep 17 00:00:00 2001 From: k1ngsterr1 Date: Thu, 19 Mar 2026 16:35:41 +0500 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BF=D1=80=D1=8B=D0=B6=D0=BA=D0=B8=20=D1=81=D0=BF?= =?UTF-8?q?=D0=B8=D1=81=D0=BA=D0=B0=20=D1=87=D0=B0=D1=82=D0=BE=D0=B2=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=20=D0=BF=D1=83=D1=81=D1=82=D1=8B=D1=85=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=BF=D1=80=D0=BE=D1=81=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../messenger/ui/chats/ChatsListScreen.kt | 63 +++++++++---------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/app/src/main/java/com/rosetta/messenger/ui/chats/ChatsListScreen.kt b/app/src/main/java/com/rosetta/messenger/ui/chats/ChatsListScreen.kt index 7e6f71a..4d07e8b 100644 --- a/app/src/main/java/com/rosetta/messenger/ui/chats/ChatsListScreen.kt +++ b/app/src/main/java/com/rosetta/messenger/ui/chats/ChatsListScreen.kt @@ -1792,6 +1792,11 @@ fun ChatsListScreen( val requestsCount = chatsState.requestsCount val showSkeleton = isLoading + val chatListState = rememberLazyListState() + var isRequestsVisible by remember { mutableStateOf(true) } + var lastAutoScrolledVerificationId by remember { + mutableStateOf(null) + } AnimatedContent( targetState = showDownloadsScreen, @@ -2057,11 +2062,6 @@ fun ChatsListScreen( } // Track scroll direction to hide/show Requests - val chatListState = rememberLazyListState() - var isRequestsVisible by remember { mutableStateOf(true) } - var lastAutoScrolledVerificationId by remember { - mutableStateOf(null) - } val hapticFeedback = LocalHapticFeedback.current // When a new device confirmation banner appears at the top, @@ -2163,13 +2163,11 @@ fun ChatsListScreen( } } - item(key = "requests_section") { - val isRequestsSectionVisible = - requestsCount > 0 && - isRequestsVisible - AnimatedVisibility( - visible = - isRequestsSectionVisible, + if (requestsCount > 0) { + item(key = "requests_section") { + AnimatedVisibility( + visible = + isRequestsVisible, enter = slideInVertically( initialOffsetY = { @@ -2238,27 +2236,28 @@ fun ChatsListScreen( tween( durationMillis = 140 - ) + ) ) - ) { - Column { - RequestsSection( - count = - requestsCount, - requests = - requests, - isDarkTheme = - isDarkTheme, - onClick = { - openRequestsRouteSafely() - } - ) - Divider( - color = - dividerColor, - thickness = - 0.5.dp - ) + ) { + Column { + RequestsSection( + count = + requestsCount, + requests = + requests, + isDarkTheme = + isDarkTheme, + onClick = { + openRequestsRouteSafely() + } + ) + Divider( + color = + dividerColor, + thickness = + 0.5.dp + ) + } } } }