feat(ui): always use two-pane layout in landscape

This commit is contained in:
OneWay committed 2026-09-18 02:15:00 +08:00
1 parent 4ce39d0e4f
commit 8a506763a5
2 files changed
+13 -2

No files matched your search

@@ -97,7 +97,7 @@ fun AdaptiveMainScreen(
) {
ArticleTitleBar(
articleState = articleState,
showBackButton = isShowingDetail,
showBackButton = isShowingDetail && articleState != null,
onNavigateBack = onNavigateBackFromArticle,
modifier = Modifier.windowInsetsPadding(
WindowInsets.safeDrawing.only(WindowInsetsSides.Top)
@@ -113,8 +113,13 @@ fun AdaptiveMainScreen(
)
}
LaunchedEffect(articleState, isQueryEmpty) {
LaunchedEffect(articleState, isQueryEmpty, isLandscape) {
val targetValue = when {
isLandscape -> ThreePaneScaffoldValue(
primary = PaneAdaptedValue.Expanded,
secondary = PaneAdaptedValue.Expanded,
tertiary = PaneAdaptedValue.Hidden,
)
articleState == null -> ThreePaneScaffoldValue(
primary = PaneAdaptedValue.Hidden,
secondary = PaneAdaptedValue.Expanded,
@@ -79,6 +79,12 @@ fun AppNavigation(
.windowSizeClass
.isWidthAtLeastBreakpoint(WIDTH_DP_MEDIUM_LOWER_BOUND)
LaunchedEffect(isWideScreen) {
if (isWideScreen) {
screenStack.removeAll { it == Screen.Article }
}
}
BackHandler(enabled = screenStack.size > 1 && !(currentScreen == Screen.Settings && isOperationActive)) {
if (currentScreen == Screen.Article) {
if (searchViewModel.navigateBackFromArticle()) {