From 42308f46bd1c88fccc47f9e2026111e845737dd4 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 9 Feb 2026 12:47:24 +0100 Subject: [PATCH] Increase content padding, and apply it to the space tab too. --- .../element/android/features/home/impl/HomeView.kt | 14 +++++--------- .../features/home/impl/spaces/HomeSpacesView.kt | 13 +++++++------ 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/HomeView.kt b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/HomeView.kt index 6465eb9a38..ca5740e646 100644 --- a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/HomeView.kt +++ b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/HomeView.kt @@ -243,6 +243,9 @@ private fun HomeScaffold( }, floatingActionButtonPosition = FabPosition.Center, content = { padding -> + val contentPadding = PaddingValues( + bottom = 112.dp, + ) when (state.currentHomeNavigationBarItem) { HomeNavigationBarItem.Chats -> { RoomListContentView( @@ -256,15 +259,7 @@ private fun HomeScaffold( onConfirmRecoveryKeyClick = onConfirmRecoveryKeyClick, onRoomClick = ::onRoomClick, onCreateRoomClick = onStartChatClick, - contentPadding = PaddingValues( - // FAB height is 56dp, bottom padding is 16dp, we add 8dp as extra margin -> 56+16+8 = 80, - // and include provided bottom padding - // Disable contentPadding due to navigation issue using the keyboard - // See https://issuetracker.google.com/issues/436432313 - bottom = 80.dp, - // bottom = 80.dp + padding.calculateBottomPadding(), - // top = padding.calculateTopPadding() - ), + contentPadding = contentPadding, modifier = Modifier .padding( PaddingValues( @@ -287,6 +282,7 @@ private fun HomeScaffold( .padding(padding) .consumeWindowInsets(padding) .hazeSource(state = hazeState), + contentPadding = contentPadding, state = state.homeSpacesState, lazyListState = spacesLazyListState, onSpaceClick = { spaceId -> diff --git a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/spaces/HomeSpacesView.kt b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/spaces/HomeSpacesView.kt index 4e93cec22d..c563e6eb26 100644 --- a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/spaces/HomeSpacesView.kt +++ b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/spaces/HomeSpacesView.kt @@ -10,6 +10,7 @@ package io.element.android.features.home.impl.spaces import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn @@ -48,6 +49,7 @@ import kotlinx.collections.immutable.toImmutableList fun HomeSpacesView( state: HomeSpacesState, lazyListState: LazyListState, + contentPadding: PaddingValues, onSpaceClick: (RoomId) -> Unit, onCreateSpaceClick: () -> Unit, onExploreClick: () -> Unit, @@ -55,7 +57,7 @@ fun HomeSpacesView( ) { if (state.canCreateSpaces && state.spaceRooms.isEmpty()) { EmptySpaceHomeView( - modifier = modifier, + modifier = modifier.padding(contentPadding), onCreateSpaceClick = onCreateSpaceClick, onExploreClick = onExploreClick, canExploreSpaces = state.canExploreSpaces, @@ -63,7 +65,8 @@ fun HomeSpacesView( } else { LazyColumn( modifier = modifier, - state = lazyListState + state = lazyListState, + contentPadding = contentPadding, ) { val space = state.space when (space) { @@ -147,10 +150,7 @@ private fun EmptySpaceHomeView( } }, footer = { - ButtonColumnMolecule( - // Add a padding bottom for the navigation bar - modifier = Modifier.padding(bottom = 112.dp) - ) { + ButtonColumnMolecule { Button( modifier = Modifier.fillMaxWidth(), text = stringResource(CommonStrings.action_create_space), @@ -179,5 +179,6 @@ internal fun HomeSpacesViewPreview( onSpaceClick = {}, onCreateSpaceClick = {}, onExploreClick = {}, + contentPadding = PaddingValues(bottom = 112.dp), ) }