Fix excessive bottom padding

This commit is contained in:
世界
2025-12-30 17:39:47 +08:00
parent 81720c4d6f
commit c3478efc3c
3 changed files with 19 additions and 9 deletions

View File

@@ -37,10 +37,16 @@ fun SFANavHost(
if (dashboardViewModel != null) {
DashboardScreen(
serviceStatus = serviceStatus,
showStartFab = showStartFab,
showStatusBar = showStatusBar,
viewModel = dashboardViewModel,
)
} else {
DashboardScreen(serviceStatus = serviceStatus)
DashboardScreen(
serviceStatus = serviceStatus,
showStartFab = showStartFab,
showStatusBar = showStatusBar,
)
}
}

View File

@@ -41,6 +41,8 @@ data class CardRenderItem(
@Composable
fun DashboardScreen(
serviceStatus: Status = Status.Stopped,
showStartFab: Boolean = false,
showStatusBar: Boolean = false,
viewModel: DashboardViewModel = viewModel(),
) {
val uiState by viewModel.uiState.collectAsState()
@@ -105,16 +107,18 @@ fun DashboardScreen(
Box(
modifier = Modifier.fillMaxSize(),
) {
val bottomPadding = when {
showStartFab -> 88.dp
showStatusBar -> 74.dp
else -> 0.dp
}
LazyColumn(
modifier =
Modifier
.fillMaxSize()
.padding(horizontal = 16.dp),
verticalArrangement = Arrangement.spacedBy(16.dp),
contentPadding =
PaddingValues(
bottom = 88.dp, // Increased to accommodate FAB (56dp height + 32dp padding)
),
contentPadding = PaddingValues(bottom = bottomPadding),
) {
// Dynamic dashboard cards
// Show cards when service is running OR if it's the Profiles card (always available)

View File

@@ -372,9 +372,9 @@ fun LogScreen(
}
} else {
// Log list
val extraBottomPadding = when {
showStartFab -> 72.dp
showStatusBar -> 58.dp
val bottomPadding = when {
showStartFab -> 88.dp
showStatusBar -> 74.dp
else -> 0.dp
}
LazyColumn(
@@ -385,7 +385,7 @@ fun LogScreen(
start = 8.dp,
end = 8.dp,
top = 8.dp,
bottom = 88.dp + extraBottomPadding, // Space for FAB
bottom = bottomPadding,
),
verticalArrangement = Arrangement.spacedBy(2.dp),
) {