fix(ui): align article title with the first search result in two panes
In landscape the detail pane rendered the title inside a fixed 56.dp bar and centered the text in it, so the headword sat about 14 dp lower than the first search result next to it. Add a compact variant of the title bar without the fixed height; the title line now shares the top offset of the first list row.
This commit is contained in:
1 parent
4e42a269a7
commit
ee19f84f91
2 files changed
+11
-4
No files matched your search
@@ -211,7 +211,8 @@ fun ArticleTitleBar(
|
||||
articleState: ArticleState?,
|
||||
showBackButton: Boolean,
|
||||
onNavigateBack: () -> Unit,
|
||||
modifier: Modifier = Modifier
|
||||
modifier: Modifier = Modifier,
|
||||
compact: Boolean = false,
|
||||
) {
|
||||
val title = when (articleState) {
|
||||
is ArticleState.Loading -> articleState.title
|
||||
@@ -230,9 +231,14 @@ fun ArticleTitleBar(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.windowInsetsPadding(AppWindowInsets.topAndHorizontalSafeDrawing)
|
||||
.padding(
|
||||
top = Spacing.listItemVertical,
|
||||
bottom = Spacing.listItemVertical
|
||||
.then(
|
||||
if (compact) {
|
||||
Modifier.padding(vertical = Spacing.listItemVertical)
|
||||
} else {
|
||||
Modifier
|
||||
.padding(top = Spacing.topBarPadding, bottom = Spacing.topBarPadding)
|
||||
.height(Spacing.topBarHeight)
|
||||
}
|
||||
),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
|
||||
@@ -99,6 +99,7 @@ fun AdaptiveMainScreen(
|
||||
articleState = articleState,
|
||||
showBackButton = isShowingDetail && articleState != null,
|
||||
onNavigateBack = onNavigateBackFromArticle,
|
||||
compact = true,
|
||||
modifier = Modifier.windowInsetsPadding(
|
||||
WindowInsets.safeDrawing.only(WindowInsetsSides.Top)
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user