From 36fb8609d559bb95c98c5808b45ef85f97603eee Mon Sep 17 00:00:00 2001 From: k1ngsterr1 Date: Tue, 3 Mar 2026 00:09:41 +0500 Subject: [PATCH] feat: adjust FAB bottom padding logic in GroupSetupScreen for improved keyboard and emoji panel handling; update font size in SearchScreen --- .../messenger/ui/chats/GroupSetupScreen.kt | 37 +++++++++---------- .../messenger/ui/chats/SearchScreen.kt | 2 +- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/com/rosetta/messenger/ui/chats/GroupSetupScreen.kt b/app/src/main/java/com/rosetta/messenger/ui/chats/GroupSetupScreen.kt index e985ede..bf953a1 100644 --- a/app/src/main/java/com/rosetta/messenger/ui/chats/GroupSetupScreen.kt +++ b/app/src/main/java/com/rosetta/messenger/ui/chats/GroupSetupScreen.kt @@ -226,19 +226,6 @@ fun GroupSetupScreen( val density = LocalDensity.current val imeBottomPx = WindowInsets.ime.getBottom(density) val imeBottomDp = with(density) { imeBottomPx.toDp() } - // FAB bottom padding: keep FAB at a consistent visual position above any keyboard. - // When emoji panel is shown → it's part of Scaffold bottomBar, paddingValues includes it, - // so we offset from the *content area* bottom which is already above the emoji panel. - // When IME is shown → paddingValues don't include IME, so we add imeBottomDp. - // When neither → just a small offset from the bottom. - val fabBottomPadding = - if (coordinator.isEmojiBoxVisible) { - 14.dp - } else if (imeBottomDp > 0.dp) { - 14.dp + imeBottomDp - } else { - 18.dp - } LaunchedEffect(step) { if (step != GroupSetupStep.DETAILS) { @@ -372,16 +359,15 @@ fun GroupSetupScreen( } } ) { paddingValues -> - Box( - modifier = - Modifier - .fillMaxSize() - .padding(paddingValues) - ) { + // Outer Box fills the full Scaffold area (no paddingValues applied) + // so the FAB can be positioned consistently above *any* keyboard. + Box(modifier = Modifier.fillMaxSize()) { + // Content area respects Scaffold padding (topBar + bottomBar/emoji) Column( modifier = Modifier .fillMaxSize() + .padding(paddingValues) .padding(horizontal = 16.dp) .navigationBarsPadding() ) { @@ -742,7 +728,18 @@ fun GroupSetupScreen( modifier = Modifier .align(Alignment.BottomEnd) - .padding(end = 16.dp, bottom = fabBottomPadding) + .padding( + end = 16.dp, + // Consistent: always 14dp above whichever keyboard is showing. + // This Box ignores paddingValues, so we measure from raw screen bottom. + bottom = if (imeBottomDp > 0.dp) { + imeBottomDp + 14.dp + } else if (coordinator.isEmojiBoxVisible && coordinator.emojiHeight > 0.dp) { + coordinator.emojiHeight + 14.dp + } else { + 18.dp + } + ) .size(58.dp) ) { if (isLoading && step == GroupSetupStep.DESCRIPTION) { diff --git a/app/src/main/java/com/rosetta/messenger/ui/chats/SearchScreen.kt b/app/src/main/java/com/rosetta/messenger/ui/chats/SearchScreen.kt index ddde2a8..cfef6c4 100644 --- a/app/src/main/java/com/rosetta/messenger/ui/chats/SearchScreen.kt +++ b/app/src/main/java/com/rosetta/messenger/ui/chats/SearchScreen.kt @@ -504,7 +504,7 @@ private fun ChatsTabContent( if (recentUsers.isNotEmpty()) { Text( "Clear All", - fontSize = 15.sp, + fontSize = 13.sp, fontWeight = FontWeight.Normal, color = PrimaryBlue, modifier = Modifier.clickable { RecentSearchesManager.clearAll() }