From add3d06713554a8b976872f8307b61175c7f7ea9 Mon Sep 17 00:00:00 2001 From: ZXCLI Date: Mon, 7 Sep 2026 20:16:39 +0800 Subject: [PATCH] android: include safe-drawing top inset in uiTopPx (image top clipped on punch-hole phones) + smaller shutter row --- analysis/preview/preview_ui_v9.png | 3 +++ .../com/mag160c/thermal/ui/live/LiveScreen.kt | 26 +++++++++++-------- build-artifacts/mag160c-app-debug.apk | 2 +- docs/android_app/HANDOFF_DEVELOPMENT.md | 5 +++- docs/android_app/session_state.md | 11 ++++++++ 5 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 analysis/preview/preview_ui_v9.png diff --git a/analysis/preview/preview_ui_v9.png b/analysis/preview/preview_ui_v9.png new file mode 100644 index 0000000..33b49f6 --- /dev/null +++ b/analysis/preview/preview_ui_v9.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c741f0ef41a6d23acb050475af51ec8932a2ccf969d20739754fa92d5b9bd9bc +size 792242 diff --git a/android/app/src/main/kotlin/com/mag160c/thermal/ui/live/LiveScreen.kt b/android/app/src/main/kotlin/com/mag160c/thermal/ui/live/LiveScreen.kt index 3cd6491..1bac758 100644 --- a/android/app/src/main/kotlin/com/mag160c/thermal/ui/live/LiveScreen.kt +++ b/android/app/src/main/kotlin/com/mag160c/thermal/ui/live/LiveScreen.kt @@ -115,11 +115,15 @@ fun LiveScreen(vm: LiveViewModel = viewModel(), onOpenGallery: () -> Unit = {}) modifier = Modifier .align(Alignment.TopCenter) .fillMaxWidth() + // onSizeChanged BEFORE the safe-drawing padding: the reported + // height must INCLUDE the cutout/status-bar inset, otherwise + // the renderer viewport starts inside the cutout strip and + // the image top hides behind the bar on punch-hole phones + .onSizeChanged { vm.uiTopPx = it.height } .windowInsetsPadding( WindowInsets.safeDrawing .only(WindowInsetsSides.Top), - ) - .onSizeChanged { vm.uiTopPx = it.height }, + ), ) { Row( modifier = Modifier @@ -204,8 +208,8 @@ fun LiveScreen(vm: LiveViewModel = viewModel(), onOpenGallery: () -> Unit = {}) vm.uiBottomPx = navPx + shutterPx } .fillMaxWidth() - .padding(vertical = 10.dp), - horizontalArrangement = Arrangement.spacedBy(52.dp, Alignment.CenterHorizontally), + .padding(vertical = 6.dp), + horizontalArrangement = Arrangement.spacedBy(44.dp, Alignment.CenterHorizontally), verticalAlignment = Alignment.CenterVertically, ) { Column( @@ -214,7 +218,7 @@ fun LiveScreen(vm: LiveViewModel = viewModel(), onOpenGallery: () -> Unit = {}) ) { Box( modifier = Modifier - .size(52.dp) + .size(42.dp) .background(Color(0x59FFFFFF), CircleShape) .clickable { onOpenGallery() }, contentAlignment = Alignment.Center, @@ -232,9 +236,9 @@ fun LiveScreen(vm: LiveViewModel = viewModel(), onOpenGallery: () -> Unit = {}) ) { Box( modifier = Modifier - .size(74.dp) + .size(60.dp) .border(4.dp, Color.White, CircleShape) - .padding(6.dp) + .padding(5.dp) .background(Color.White, CircleShape) .clickable { vm.capturePhoto(context) }, ) @@ -249,7 +253,7 @@ fun LiveScreen(vm: LiveViewModel = viewModel(), onOpenGallery: () -> Unit = {}) ) { Box( modifier = Modifier - .size(52.dp) + .size(42.dp) .border(3.dp, Color(0xFFFF5252), CircleShape) .clickable { vm.toggleRecording(context) }, contentAlignment = Alignment.Center, @@ -257,13 +261,13 @@ fun LiveScreen(vm: LiveViewModel = viewModel(), onOpenGallery: () -> Unit = {}) if (recording) { Box( modifier = Modifier - .size(20.dp) - .background(Color(0xFFFF5252), RoundedCornerShape(4.dp)), + .size(16.dp) + .background(Color(0xFFFF5252), RoundedCornerShape(3.dp)), ) } else { Box( modifier = Modifier - .size(24.dp) + .size(19.dp) .background(Color(0xFFFF5252), CircleShape), ) } diff --git a/build-artifacts/mag160c-app-debug.apk b/build-artifacts/mag160c-app-debug.apk index 1beac62..a0b73e1 100644 --- a/build-artifacts/mag160c-app-debug.apk +++ b/build-artifacts/mag160c-app-debug.apk @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1724e546b307e0f5a99c92a5c5a4701feb9cf14bf4322b14dc4d05a4038910db +oid sha256:e9069b65f5822d9bdca4bbbdf0a28ad05d0891b344149009f49dad546caab598 size 12232282 diff --git a/docs/android_app/HANDOFF_DEVELOPMENT.md b/docs/android_app/HANDOFF_DEVELOPMENT.md index d1940f2..2e022c2 100644 --- a/docs/android_app/HANDOFF_DEVELOPMENT.md +++ b/docs/android_app/HANDOFF_DEVELOPMENT.md @@ -122,7 +122,10 @@ res/drawable/*.xml 自绘矢量图标(双弧圆等可靠几何图形 标签,`safeDrawing` 顶部inset 适配挖孔屏。 - 底部(仅实时页)导航栏上方为**相机快门区**:相册快捷入口 / 大快门拍照 / 录像-停止;快门区高度并入 `vm.uiBottomPx`(= 导航高+快门区高)。 -- 顶栏高度经 `onSizeChanged`→`vm.uiTopPx`;底导航高度经 `UiInsets.navPx`→`vm.uiBottomPx`,渲染器据此留白。 +- 顶栏高度经 `onSizeChanged`→`vm.uiTopPx`(**必须挂在 safeDrawing inset 之前**, + 即包含挖孔安全区高度,否则真机热像顶端会插进顶栏背后);底导航高度经 + `UiInsets.navPx`、快门区高度经其 `onSizeChanged`→`vm.uiBottomPx`(= 导航+快门区), + 渲染器据此留白。 - 演示模式:无设备时用真实管线+DDT渲染合成帧(热块场景),demo温度用局部线性显示映射 (真机温度走管线数学;绝对温度标定待真机)。 diff --git a/docs/android_app/session_state.md b/docs/android_app/session_state.md index 257f358..8da5ff8 100644 --- a/docs/android_app/session_state.md +++ b/docs/android_app/session_state.md @@ -179,6 +179,17 @@ - [x] 模拟器实测:0°/90° 姿态布局、旋转补偿、图像区域均正确 (preview_ui_v8.png / preview_ui90_v8.png);单元测试全过;APK 已更新。 +## 用户反馈修复 第九轮(2026-09-07,真机热像顶端被顶栏遮挡) + +- [x] **用户反馈**:真机上快门区把热像显示区顶满后,热像最顶端被顶栏盖住看不见。 +- [x] **根因**:顶栏 `onSizeChanged` 挂在 `safeDrawing` 挖孔 inset 内侧,`uiTopPx` + 不含挖孔安全区高度;模拟器无挖孔看不出来。快门区加入后剩余高度变小、热像 + 进入"高度受限"铺满视口状态,顶端误差直接表现为热像顶端插入顶栏背后。 +- [x] **修复**:`onSizeChanged` 移到 `windowInsetsPadding` 之前(`uiTopPx` = 挖孔 + 安全区 + 顶栏全高,渲染器视口完整跳过顶栏);同时按要求缩小快门区 + (相册/录像 42dp、快门 60dp、纵向 padding 6dp、间距 44dp)。 +- [x] 模拟器复测布局正常,单元测试全过;APK 已更新。 + ## 待办 - 真机USB实测(温度绝对值标定、FFC/录像/MDT保存端到端)