From d456bdf4b5dc1736c3e68223ca421e9c1c22199b Mon Sep 17 00:00:00 2001 From: QIU Date: Mon, 3 Aug 2026 15:22:08 +0000 Subject: [PATCH] fix(roaming): stretch side cells to 80dp like the reference RelativeLayout The user spotted two white "beams" (20dp gaps) between the center cell and the side cells. Root cause: the reference app's RelativeLayout ignores the fixed 60dp width when a child has BOTH a left rule (alignParentLeft) and a right rule (toLeftOf=center cell) - the width is stretched to right-rule minus left-rule, i.e. 80dp on a 360dp screen. The three cells therefore sit flush with only 2dp margins between them, no gaps. Port that behavior: side cells 60dp -> 80dp (6 places), center cell stays 200dp centered. Verified against the reference screenshot pixel measurements (side cells ~76.5dp incl. margins, center ~198dp). Verified: feature + app compile, 11 unit tests pass. Marker lookup, grid math and GPS logic untouched. --- .../look4sat/feature/roaming/RoamingScreen.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 b014e6c3..d869cff6 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 @@ -269,13 +269,13 @@ fun RoamingScreen() { Column(modifier = Modifier.fillMaxWidth().weight(1f).padding(bottom = 15.dp)) { // 行1: relativeLayout5 (上排: 纬度 +1) Box(modifier = Modifier.fillMaxWidth().weight(1f)) { - GridCell(text = state.grids[0], modifier = Modifier.width(60.dp).fillMaxHeight().align(Alignment.CenterStart)) + GridCell(text = state.grids[0], modifier = Modifier.width(80.dp).fillMaxHeight().align(Alignment.CenterStart)) GridCell(text = state.grids[1], modifier = Modifier.width(200.dp).fillMaxHeight().align(Alignment.Center)) - GridCell(text = state.grids[2], modifier = Modifier.width(60.dp).fillMaxHeight().align(Alignment.CenterEnd)) + GridCell(text = state.grids[2], modifier = Modifier.width(80.dp).fillMaxHeight().align(Alignment.CenterEnd)) } // 行2: relativeLayout4, 205dp 高 (中排: 中央) Box(modifier = Modifier.fillMaxWidth().height(205.dp)) { - GridCell(text = state.grids[3], modifier = Modifier.width(60.dp).fillMaxHeight().align(Alignment.CenterStart)) + GridCell(text = state.grids[3], modifier = Modifier.width(80.dp).fillMaxHeight().align(Alignment.CenterStart)) // 中央列: tv22 (100x80dp centerInParent) 叠在 linearLayout3 (200x200dp) 之上 Box(modifier = Modifier.width(200.dp).fillMaxHeight().align(Alignment.Center)) { // linearLayout3: 200x200dp, marginTop 2dp, holo_blue_bright @@ -307,13 +307,13 @@ fun RoamingScreen() { .align(Alignment.Center) ) } - GridCell(text = state.grids[5], modifier = Modifier.width(60.dp).fillMaxHeight().align(Alignment.CenterEnd)) + GridCell(text = state.grids[5], modifier = Modifier.width(80.dp).fillMaxHeight().align(Alignment.CenterEnd)) } // 行3: relativeLayout3 (下排: 纬度 -1) Box(modifier = Modifier.fillMaxWidth().weight(1f)) { - GridCell(text = state.grids[6], modifier = Modifier.width(60.dp).fillMaxHeight().align(Alignment.CenterStart)) + GridCell(text = state.grids[6], modifier = Modifier.width(80.dp).fillMaxHeight().align(Alignment.CenterStart)) GridCell(text = state.grids[7], modifier = Modifier.width(200.dp).fillMaxHeight().align(Alignment.Center)) - GridCell(text = state.grids[8], modifier = Modifier.width(60.dp).fillMaxHeight().align(Alignment.CenterEnd)) + GridCell(text = state.grids[8], modifier = Modifier.width(80.dp).fillMaxHeight().align(Alignment.CenterEnd)) } } // tv4: 底部版权, 10sp 黑 (往上拉, 底部预留空间避免被导航栏遮挡)