feat: adjust FAB bottom padding logic in GroupSetupScreen for improved keyboard and emoji panel handling; update font size in SearchScreen

This commit is contained in:
2026-03-03 00:09:41 +05:00
parent 50b27fcbb3
commit 36fb8609d5
2 changed files with 18 additions and 21 deletions

View File

@@ -226,19 +226,6 @@ fun GroupSetupScreen(
val density = LocalDensity.current val density = LocalDensity.current
val imeBottomPx = WindowInsets.ime.getBottom(density) val imeBottomPx = WindowInsets.ime.getBottom(density)
val imeBottomDp = with(density) { imeBottomPx.toDp() } 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) { LaunchedEffect(step) {
if (step != GroupSetupStep.DETAILS) { if (step != GroupSetupStep.DETAILS) {
@@ -372,16 +359,15 @@ fun GroupSetupScreen(
} }
} }
) { paddingValues -> ) { paddingValues ->
Box( // Outer Box fills the full Scaffold area (no paddingValues applied)
modifier = // so the FAB can be positioned consistently above *any* keyboard.
Modifier Box(modifier = Modifier.fillMaxSize()) {
.fillMaxSize() // Content area respects Scaffold padding (topBar + bottomBar/emoji)
.padding(paddingValues)
) {
Column( Column(
modifier = modifier =
Modifier Modifier
.fillMaxSize() .fillMaxSize()
.padding(paddingValues)
.padding(horizontal = 16.dp) .padding(horizontal = 16.dp)
.navigationBarsPadding() .navigationBarsPadding()
) { ) {
@@ -742,7 +728,18 @@ fun GroupSetupScreen(
modifier = modifier =
Modifier Modifier
.align(Alignment.BottomEnd) .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) .size(58.dp)
) { ) {
if (isLoading && step == GroupSetupStep.DESCRIPTION) { if (isLoading && step == GroupSetupStep.DESCRIPTION) {

View File

@@ -504,7 +504,7 @@ private fun ChatsTabContent(
if (recentUsers.isNotEmpty()) { if (recentUsers.isNotEmpty()) {
Text( Text(
"Clear All", "Clear All",
fontSize = 15.sp, fontSize = 13.sp,
fontWeight = FontWeight.Normal, fontWeight = FontWeight.Normal,
color = PrimaryBlue, color = PrimaryBlue,
modifier = Modifier.clickable { RecentSearchesManager.clearAll() } modifier = Modifier.clickable { RecentSearchesManager.clearAll() }