feat: refactor ListDetailScreen layout for improved header and content alignment; enhance empty state messaging
This commit is contained in:
+12
-11
@@ -495,17 +495,11 @@ fun ListDetailScreen(
|
||||
pendingScrollToBottom = false
|
||||
}
|
||||
}
|
||||
Column(
|
||||
modifier =
|
||||
Modifier
|
||||
.fillMaxSize()
|
||||
.horizontalScroll(horizontalScrollState),
|
||||
) {
|
||||
// Fixed header (always visible even with zero items)
|
||||
// Header: horizontally scrollable across the table width
|
||||
Row(
|
||||
modifier =
|
||||
Modifier
|
||||
.fillMaxWidth()
|
||||
.horizontalScroll(horizontalScrollState)
|
||||
.background(MaterialTheme.colorScheme.surface),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
@@ -537,7 +531,7 @@ fun ListDetailScreen(
|
||||
}
|
||||
}
|
||||
|
||||
// Render content states outside the horizontalScroll so empty state centers relative to viewport
|
||||
// Content area: if empty, center message; else render horizontally scrollable rows
|
||||
when {
|
||||
isLoading && stableItems.isEmpty() -> {
|
||||
Box(
|
||||
@@ -546,9 +540,9 @@ fun ListDetailScreen(
|
||||
) { androidx.compose.material3.CircularProgressIndicator() }
|
||||
}
|
||||
stableItems.isEmpty() -> {
|
||||
// Use full-width Box + centered text (header remains above inside scroll container)
|
||||
Box(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
modifier = Modifier
|
||||
.fillMaxSize(),
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
Text(
|
||||
@@ -582,6 +576,13 @@ fun ListDetailScreen(
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
// Content list in a horizontally scrollable container to stay aligned with header
|
||||
Column(
|
||||
modifier =
|
||||
Modifier
|
||||
.fillMaxSize()
|
||||
.horizontalScroll(horizontalScrollState),
|
||||
) {
|
||||
LazyColumn(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
state = listState,
|
||||
|
||||
Reference in New Issue
Block a user