依旧主页面底部边距问题

This commit is contained in:
HapeLee
2026-05-14 19:39:47 +08:00
parent a6441ed5c7
commit f0de84d511
@@ -25,8 +25,11 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
@@ -212,11 +215,17 @@ fun BookshelfScreen(
val scrollBehavior = GlassTopAppBarDefaults.defaultScrollBehavior()
AppScaffold(
modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
contentWindowInsets = WindowInsets(0),
snackbarHost = {
SnackbarHost(
hostState = snackbarHostState,
modifier = Modifier
.padding(bottom = 72.dp)
.padding(
bottom = 72.dp + WindowInsets.navigationBars
.asPaddingValues()
.calculateBottomPadding()
)
)
},
topBar = {
@@ -238,7 +247,7 @@ fun BookshelfScreen(
.fillMaxSize()
.padding(
top = paddingValues.calculateTopPadding(),
bottom = paddingValues.calculateBottomPadding()
bottom = 120.dp
),
messageResId = R.string.bookshelf_empty
)
@@ -384,11 +393,16 @@ fun BookshelfScreen(
AppScaffold(
modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
contentWindowInsets = WindowInsets(0),
snackbarHost = {
SnackbarHost(
hostState = snackbarHostState,
modifier = Modifier
.padding(bottom = 72.dp)
.padding(
bottom = 72.dp + WindowInsets.navigationBars
.asPaddingValues()
.calculateBottomPadding()
)
)
},
topBar = {
@@ -989,7 +1003,11 @@ fun BookshelfScreen(
visible = isEditMode && selectedBookUrls.isNotEmpty(),
modifier = Modifier
.align(Alignment.BottomCenter)
.padding(bottom = 16.dp + ScreenOffset)
.padding(
bottom = 16.dp + ScreenOffset + WindowInsets.navigationBars
.asPaddingValues()
.calculateBottomPadding()
)
.zIndex(1f),
enter = slideInVertically { it } + fadeIn(),
exit = slideOutVertically { it } + fadeOut()
@@ -1195,7 +1213,7 @@ fun BookshelfPage(
.fillMaxSize()
.padding(
top = paddingValues.calculateTopPadding(),
bottom = paddingValues.calculateBottomPadding()
bottom = 120.dp
),
message = stringResource(R.string.bookshelf_empty_global_search),
buttonText = stringResource(R.string.global_search),
@@ -1207,7 +1225,7 @@ fun BookshelfPage(
.fillMaxSize()
.padding(
top = paddingValues.calculateTopPadding(),
bottom = paddingValues.calculateBottomPadding()
bottom = 120.dp
),
messageResId = R.string.bookshelf_empty
)