From 50b27fcbb3ed2c2c4df31fddb96037b3e28f708c Mon Sep 17 00:00:00 2001 From: k1ngsterr1 Date: Tue, 3 Mar 2026 00:02:27 +0500 Subject: [PATCH] feat: update FAB bottom padding logic in GroupSetupScreen to improve positioning with keyboard and emoji panel --- .../com/rosetta/messenger/ui/chats/GroupSetupScreen.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 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 47f814e..e985ede 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,14 +226,15 @@ 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) { - // Emoji panel is shown as Scaffold bottomBar → paddingValues already - // reserves space for it, so FAB only needs a small offset above it. 14.dp } else if (imeBottomDp > 0.dp) { - // System keyboard is open but NOT covered by paddingValues. - // Place FAB at the same visual position as with the emoji panel. 14.dp + imeBottomDp } else { 18.dp