From 675194075e9147535ca8fdd1d201e082429e0a3c Mon Sep 17 00:00:00 2001 From: QIU Date: Mon, 3 Aug 2026 14:55:46 +0000 Subject: [PATCH] fix(roaming): inset page content from system bars MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ported page rendered edge-to-edge: the GPS bar started right at the top of the screen and the footer sat against the navigation bar, so system UI overlapped the content (user: "顶头"). The reference app is not edge-to-edge and keeps its content inside the safe area. Add windowInsetsPadding(WindowInsets.systemBars) on the page root column, shrinking the top and bottom by the status/navigation bar height exactly as the user requested ("上方和下方往里面缩一点点"). Grid columns (60/200/60dp), rows, marker lookup and all logic are untouched - verified pixel-identical column ratios vs the reference screenshot (147:395:147 vs 146:395:148). Verified: feature + app compile, 11 unit tests pass. --- .../look4sat/feature/roaming/RoamingScreen.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/feature/roaming/src/main/java/com/rtbishop/look4sat/feature/roaming/RoamingScreen.kt b/feature/roaming/src/main/java/com/rtbishop/look4sat/feature/roaming/RoamingScreen.kt index 1585559b..c5d8f571 100644 --- a/feature/roaming/src/main/java/com/rtbishop/look4sat/feature/roaming/RoamingScreen.kt +++ b/feature/roaming/src/main/java/com/rtbishop/look4sat/feature/roaming/RoamingScreen.kt @@ -46,6 +46,9 @@ import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.Text +import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.windowInsetsPadding +import androidx.compose.foundation.layout.systemBars import androidx.compose.runtime.Composable import androidx.compose.runtime.DisposableEffect import androidx.compose.runtime.LaunchedEffect @@ -137,7 +140,13 @@ fun RoamingScreen() { } } // 照搬 res/layout/main.xml: 浅色页面, 蓝色信息区, 43sp 定位码, 3x3 九宫格, 底部版权 - Column(modifier = Modifier.fillMaxSize().background(Color(0xFFF2F2F2))) { + // 按用户要求: 上下往内缩进系统栏安全区, 避免内容被状态栏/导航栏遮挡 + Column( + modifier = Modifier + .fillMaxSize() + .background(Color(0xFFF2F2F2)) + .windowInsetsPadding(WindowInsets.systemBars) + ) { // relativeLayout7: 顶部 GPS 状态条, 25dp 高, holo_blue_bright Box( modifier = Modifier