Increase content padding, and apply it to the space tab too.
This commit is contained in:
parent
56165b2faf
commit
42308f46bd
2 changed files with 12 additions and 15 deletions
|
|
@ -243,6 +243,9 @@ private fun HomeScaffold(
|
||||||
},
|
},
|
||||||
floatingActionButtonPosition = FabPosition.Center,
|
floatingActionButtonPosition = FabPosition.Center,
|
||||||
content = { padding ->
|
content = { padding ->
|
||||||
|
val contentPadding = PaddingValues(
|
||||||
|
bottom = 112.dp,
|
||||||
|
)
|
||||||
when (state.currentHomeNavigationBarItem) {
|
when (state.currentHomeNavigationBarItem) {
|
||||||
HomeNavigationBarItem.Chats -> {
|
HomeNavigationBarItem.Chats -> {
|
||||||
RoomListContentView(
|
RoomListContentView(
|
||||||
|
|
@ -256,15 +259,7 @@ private fun HomeScaffold(
|
||||||
onConfirmRecoveryKeyClick = onConfirmRecoveryKeyClick,
|
onConfirmRecoveryKeyClick = onConfirmRecoveryKeyClick,
|
||||||
onRoomClick = ::onRoomClick,
|
onRoomClick = ::onRoomClick,
|
||||||
onCreateRoomClick = onStartChatClick,
|
onCreateRoomClick = onStartChatClick,
|
||||||
contentPadding = PaddingValues(
|
contentPadding = contentPadding,
|
||||||
// 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()
|
|
||||||
),
|
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(
|
.padding(
|
||||||
PaddingValues(
|
PaddingValues(
|
||||||
|
|
@ -287,6 +282,7 @@ private fun HomeScaffold(
|
||||||
.padding(padding)
|
.padding(padding)
|
||||||
.consumeWindowInsets(padding)
|
.consumeWindowInsets(padding)
|
||||||
.hazeSource(state = hazeState),
|
.hazeSource(state = hazeState),
|
||||||
|
contentPadding = contentPadding,
|
||||||
state = state.homeSpacesState,
|
state = state.homeSpacesState,
|
||||||
lazyListState = spacesLazyListState,
|
lazyListState = spacesLazyListState,
|
||||||
onSpaceClick = { spaceId ->
|
onSpaceClick = { spaceId ->
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ package io.element.android.features.home.impl.spaces
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
|
|
@ -48,6 +49,7 @@ import kotlinx.collections.immutable.toImmutableList
|
||||||
fun HomeSpacesView(
|
fun HomeSpacesView(
|
||||||
state: HomeSpacesState,
|
state: HomeSpacesState,
|
||||||
lazyListState: LazyListState,
|
lazyListState: LazyListState,
|
||||||
|
contentPadding: PaddingValues,
|
||||||
onSpaceClick: (RoomId) -> Unit,
|
onSpaceClick: (RoomId) -> Unit,
|
||||||
onCreateSpaceClick: () -> Unit,
|
onCreateSpaceClick: () -> Unit,
|
||||||
onExploreClick: () -> Unit,
|
onExploreClick: () -> Unit,
|
||||||
|
|
@ -55,7 +57,7 @@ fun HomeSpacesView(
|
||||||
) {
|
) {
|
||||||
if (state.canCreateSpaces && state.spaceRooms.isEmpty()) {
|
if (state.canCreateSpaces && state.spaceRooms.isEmpty()) {
|
||||||
EmptySpaceHomeView(
|
EmptySpaceHomeView(
|
||||||
modifier = modifier,
|
modifier = modifier.padding(contentPadding),
|
||||||
onCreateSpaceClick = onCreateSpaceClick,
|
onCreateSpaceClick = onCreateSpaceClick,
|
||||||
onExploreClick = onExploreClick,
|
onExploreClick = onExploreClick,
|
||||||
canExploreSpaces = state.canExploreSpaces,
|
canExploreSpaces = state.canExploreSpaces,
|
||||||
|
|
@ -63,7 +65,8 @@ fun HomeSpacesView(
|
||||||
} else {
|
} else {
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
state = lazyListState
|
state = lazyListState,
|
||||||
|
contentPadding = contentPadding,
|
||||||
) {
|
) {
|
||||||
val space = state.space
|
val space = state.space
|
||||||
when (space) {
|
when (space) {
|
||||||
|
|
@ -147,10 +150,7 @@ private fun EmptySpaceHomeView(
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
footer = {
|
footer = {
|
||||||
ButtonColumnMolecule(
|
ButtonColumnMolecule {
|
||||||
// Add a padding bottom for the navigation bar
|
|
||||||
modifier = Modifier.padding(bottom = 112.dp)
|
|
||||||
) {
|
|
||||||
Button(
|
Button(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
text = stringResource(CommonStrings.action_create_space),
|
text = stringResource(CommonStrings.action_create_space),
|
||||||
|
|
@ -179,5 +179,6 @@ internal fun HomeSpacesViewPreview(
|
||||||
onSpaceClick = {},
|
onSpaceClick = {},
|
||||||
onCreateSpaceClick = {},
|
onCreateSpaceClick = {},
|
||||||
onExploreClick = {},
|
onExploreClick = {},
|
||||||
|
contentPadding = PaddingValues(bottom = 112.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue