fix(android): hide nav under command palette · openclaw/openclaw@e5e6cf0
obviyus
·
2026-06-03
·
via Recent Commits to openclaw:main
File tree
main/java/ai/openclaw/app/ui
test/java/ai/openclaw/app/ui
| Original file line number | Diff line number | Diff line change |
|---|
@@ -103,6 +103,8 @@ private val shellNavTabs = listOf(Tab.Overview, Tab.Chat, Tab.Voice, Tab.Setting
|
103 | 103 | private val shellContentInsets: WindowInsets |
104 | 104 | @Composable get() = WindowInsets.safeDrawing.only(WindowInsetsSides.Top + WindowInsetsSides.Horizontal) |
105 | 105 | |
| 106 | +internal fun shellBottomNavVisible(keyboardVisible: Boolean, commandOpen: Boolean): Boolean = !keyboardVisible && !commandOpen |
| 107 | + |
106 | 108 | /** Main post-onboarding shell that owns top-level Android navigation state. */ |
107 | 109 | @Composable |
108 | 110 | fun ShellScreen( |
@@ -150,13 +152,14 @@ fun ShellScreen(
|
150 | 152 | |
151 | 153 | val density = LocalDensity.current |
152 | 154 | val keyboardVisible = WindowInsets.ime.getBottom(density) > 0 |
| 155 | +val showBottomNav = shellBottomNavVisible(keyboardVisible = keyboardVisible, commandOpen = commandOpen) |
153 | 156 | |
154 | 157 | Scaffold( |
155 | 158 | modifier = modifier.fillMaxSize(), |
156 | 159 | containerColor = ClawTheme.colors.canvas, |
157 | 160 | contentWindowInsets = WindowInsets(0, 0, 0, 0), |
158 | 161 | bottomBar = { |
159 | | -if (!keyboardVisible) { |
| 162 | +if (showBottomNav) { |
160 | 163 | ClawBottomNav( |
161 | 164 | items = shellNavTabs.map { ClawNavItem(key = it.key, label = it.label, icon = it.icon) }, |
162 | 165 | selectedKey = if (activeTab in shellNavTabs) activeTab.key else Tab.Overview.key, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -5,9 +5,18 @@ import ai.openclaw.app.GatewayChannelsSummary
|
5 | 5 | import ai.openclaw.app.GatewayNodesDevicesSummary |
6 | 6 | import ai.openclaw.app.GatewayPendingDeviceSummary |
7 | 7 | import org.junit.Assert.assertEquals |
| 8 | +import org.junit.Assert.assertFalse |
| 9 | +import org.junit.Assert.assertTrue |
8 | 10 | import org.junit.Test |
9 | 11 | |
10 | 12 | class ShellScreenLogicTest { |
| 13 | + @Test |
| 14 | +fun bottomNavHidesForKeyboardAndCommandPalette() { |
| 15 | + assertTrue(shellBottomNavVisible(keyboardVisible = false, commandOpen = false)) |
| 16 | + assertFalse(shellBottomNavVisible(keyboardVisible = true, commandOpen = false)) |
| 17 | + assertFalse(shellBottomNavVisible(keyboardVisible = false, commandOpen = true)) |
| 18 | + } |
| 19 | + |
11 | 20 | @Test |
12 | 21 | fun homeAttentionRowsSurfaceGatewayWhenDisconnected() { |
13 | 22 | val rows = |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。