feat(ui): always use two-pane layout in landscape
This commit is contained in:
1 parent
4ce39d0e4f
commit
8a506763a5
2 files changed
+13
-2
No files matched your search
@@ -97,7 +97,7 @@ fun AdaptiveMainScreen(
|
|||||||
) {
|
) {
|
||||||
ArticleTitleBar(
|
ArticleTitleBar(
|
||||||
articleState = articleState,
|
articleState = articleState,
|
||||||
showBackButton = isShowingDetail,
|
showBackButton = isShowingDetail && articleState != null,
|
||||||
onNavigateBack = onNavigateBackFromArticle,
|
onNavigateBack = onNavigateBackFromArticle,
|
||||||
modifier = Modifier.windowInsetsPadding(
|
modifier = Modifier.windowInsetsPadding(
|
||||||
WindowInsets.safeDrawing.only(WindowInsetsSides.Top)
|
WindowInsets.safeDrawing.only(WindowInsetsSides.Top)
|
||||||
@@ -113,8 +113,13 @@ fun AdaptiveMainScreen(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
LaunchedEffect(articleState, isQueryEmpty) {
|
LaunchedEffect(articleState, isQueryEmpty, isLandscape) {
|
||||||
val targetValue = when {
|
val targetValue = when {
|
||||||
|
isLandscape -> ThreePaneScaffoldValue(
|
||||||
|
primary = PaneAdaptedValue.Expanded,
|
||||||
|
secondary = PaneAdaptedValue.Expanded,
|
||||||
|
tertiary = PaneAdaptedValue.Hidden,
|
||||||
|
)
|
||||||
articleState == null -> ThreePaneScaffoldValue(
|
articleState == null -> ThreePaneScaffoldValue(
|
||||||
primary = PaneAdaptedValue.Hidden,
|
primary = PaneAdaptedValue.Hidden,
|
||||||
secondary = PaneAdaptedValue.Expanded,
|
secondary = PaneAdaptedValue.Expanded,
|
||||||
|
|||||||
@@ -79,6 +79,12 @@ fun AppNavigation(
|
|||||||
.windowSizeClass
|
.windowSizeClass
|
||||||
.isWidthAtLeastBreakpoint(WIDTH_DP_MEDIUM_LOWER_BOUND)
|
.isWidthAtLeastBreakpoint(WIDTH_DP_MEDIUM_LOWER_BOUND)
|
||||||
|
|
||||||
|
LaunchedEffect(isWideScreen) {
|
||||||
|
if (isWideScreen) {
|
||||||
|
screenStack.removeAll { it == Screen.Article }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
BackHandler(enabled = screenStack.size > 1 && !(currentScreen == Screen.Settings && isOperationActive)) {
|
BackHandler(enabled = screenStack.size > 1 && !(currentScreen == Screen.Settings && isOperationActive)) {
|
||||||
if (currentScreen == Screen.Article) {
|
if (currentScreen == Screen.Article) {
|
||||||
if (searchViewModel.navigateBackFromArticle()) {
|
if (searchViewModel.navigateBackFromArticle()) {
|
||||||
|
|||||||
Reference in new issue
Block a user