fix(roaming): inset page content from system bars
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.
This commit is contained in:
1 parent
0ecccc4746
commit
675194075e
1 file changed
+10
-1
+10
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user