v0.5.0 抽屉改「应用内左右滑动」触发 + 去掉汉堡按钮 + 统一区块边距
用户 2026-10-12 三条反馈。 ## ① 抽屉改「应用内水平滑动」触发(关键更正) 用户实测指出:「左滑右滑不是从边上滑,而是在应用的内部从左往右滑或者从右往左滑。 如果从边上往里边滑的话,它是系统手势,我们是没有办法去控制它的。」 ⇒ **这是之前手势完全没生效的根因**:屏幕边缘是系统手势区(返回/侧边栏), 从边缘往里滑的事件根本轮不到应用。判据改为「在应用内部水平滑动」: · 向右滑 ⇒ 抽屉从左边出;· 向左滑 ⇒ 抽屉从右边出。 (左手持机往右划、右手持机往左划,单手都顺。) 🔴 同时修掉一个真 bug:**`offsetX` 的单位是 vp**(SDK 原文 "in vp"), 我之前又除以 density,把位移缩到 1/3 ⇒ 阈值永远达不到。 ⚠️ 用 `parallelGesture`(不是 gesture):内容区还有竖向滚动与 纪念日/财务/任务的横向滚动条,用 gesture 会把它们抢掉。 阈值 80vp,轻扫横向列表不会误开。 ## ② 去掉顶栏汉堡按钮 用户:「那个三个点、三个横线的按钮就不要了,图标靠左,显得更好看一些」。 ⇒ TopBar 删掉按钮,`padding.left` 由 14 改为 `pagePad`,图标与下方内容左边线对齐。 ## ③ 🔴 统一区块边距(修掉 15 处真 bug) 用户:「页面里的方框大小不一样,有的左右充满,有的有缝隙 —— 最好都留一点距离」。 实测界面树 + 像素采样找到根因:**卡片同时写了 `.width('100%')` 和 `.margin({left, right})` ⇒ width 先把宽度占满、margin 失效,卡片顶到屏幕两侧**。 (首页个人信息卡实测 x=0..1080 满宽,而别的区块是留边 17vp 的。) 全项目扫出 **15 处**同款写法(calendar 3 / days 2 / ledger 2 / movies 1 / people 2 / settings 5),**全是卡片**(backgroundColor+borderRadius+margin)。 统一删掉那条 `.width('100%')`,宽度交给 margin 撑出。 ### 验证(真机) · 手势:向右滑 ⇒ 抽屉「家书」x=187(贴左);向左滑 ⇒ x=442(贴右)—— 双向 ✓ · 边距:像素级逐行采样,17 行里 15 行左右均 50px(17vp)完全一致; 另 2 行是"标题文字起点"(文字有额外缩进),不是边距问题 ✓ · 14 页遍历 **14/14**;深验(每页特征文本)**12/12** · 编译 **0 error / 0 warning** ### 工具链修复(都很关键) · 🔴 `hdc file recv` 在 **Git Bash** 下会被路径转换改写:`/data/local/tmp/x` 被当成 `C:/.../tmp/x` ⇒ **静默失败、界面树永远抓不到**。 三个验证脚本已统一注入 `MSYS_NO_PATHCONV=1`。 · 探针不再点汉堡按钮开抽屉(按钮已删),改用「应用内向右滑」。 · 修探针一处误判:顶栏与抽屉**都有**「家书」,原来没区分 ⇒ 两种滑动都读到顶栏那个固定 x,误报"手势没生效"(其实生效了)。
This commit is contained in:
@@ -147,7 +147,6 @@ export struct FbCalendarPage {
|
||||
.height(this.gridHeight())
|
||||
.scrollBar(BarState.Off)
|
||||
}
|
||||
.width('100%')
|
||||
.padding(FbMetric.cardPad)
|
||||
.backgroundColor(FbColors.surface)
|
||||
.borderRadius(FbMetric.radius)
|
||||
@@ -205,7 +204,6 @@ export struct FbCalendarPage {
|
||||
.width('100%')
|
||||
.padding({ left: FbMetric.cardPad, right: FbMetric.cardPad, bottom: 6 })
|
||||
}
|
||||
.width('100%')
|
||||
.backgroundColor(FbColors.surface)
|
||||
.borderRadius(FbMetric.radius)
|
||||
.margin({ left: FbMetric.pagePad, right: FbMetric.pagePad, top: 12 })
|
||||
@@ -233,7 +231,6 @@ export struct FbCalendarPage {
|
||||
.width('100%')
|
||||
.padding({ left: FbMetric.cardPad, right: FbMetric.cardPad, bottom: 6 })
|
||||
}
|
||||
.width('100%')
|
||||
.backgroundColor(FbColors.surface)
|
||||
.borderRadius(FbMetric.radius)
|
||||
.margin({ left: FbMetric.pagePad, right: FbMetric.pagePad, top: 12, bottom: 28 })
|
||||
|
||||
@@ -98,7 +98,6 @@ export struct FbDaysPage {
|
||||
.width('100%')
|
||||
}
|
||||
}
|
||||
.width('100%')
|
||||
.padding(FbMetric.cardPad)
|
||||
.backgroundColor(FbColors.surface)
|
||||
.borderRadius(FbMetric.radius)
|
||||
@@ -127,7 +126,6 @@ export struct FbDaysPage {
|
||||
this.annRow(a, idx === this.filtered().length - 1)
|
||||
}, (a: FbAnniversaryItem): string => 'ann_' + a.id.toString())
|
||||
}
|
||||
.width('100%')
|
||||
.padding({ left: FbMetric.cardPad, right: FbMetric.cardPad, top: 4, bottom: 8 })
|
||||
.backgroundColor(FbColors.surface)
|
||||
.borderRadius(FbMetric.radius)
|
||||
|
||||
@@ -171,9 +171,12 @@ export struct FbHomePage {
|
||||
cAlarm: FB_DEMO_WEEK_STAT.overdue > 0
|
||||
})
|
||||
}
|
||||
.width('100%')
|
||||
// 🔴 不要 `.width('100%')` —— 它会先把宽度占满,导致后面的 margin 失效,
|
||||
// 卡片于是**顶到屏幕两侧边缘**(实测 x=0..1080),而别的区块是留边 16vp 的,
|
||||
// 页面里就出现"有的满宽、有的有缝"的不统一(用户 2026-10-12 的反馈)。
|
||||
// 正确做法:**只给 margin**,宽度由 margin 自动撑出(左右各 16vp)。
|
||||
.padding(FbMetric.cardPad)
|
||||
// 白色卡片(用户要求):与下面「今天的日程」等块同一种卡片语言
|
||||
// 白色卡片:与下面「今天的日程」等块同一种卡片语言
|
||||
.backgroundColor(FbColors.surface)
|
||||
.borderRadius(FbMetric.radius)
|
||||
.margin({
|
||||
|
||||
@@ -168,7 +168,6 @@ export struct FbLedgerPage {
|
||||
.width('100%')
|
||||
.alignItems(HorizontalAlign.Start)
|
||||
}
|
||||
.width('100%')
|
||||
.padding(FbMetric.cardPad)
|
||||
.backgroundColor(FbColors.surface)
|
||||
.borderRadius(FbMetric.radius)
|
||||
@@ -219,7 +218,6 @@ export struct FbLedgerPage {
|
||||
}
|
||||
.width('100%')
|
||||
}
|
||||
.width('100%')
|
||||
.padding(FbMetric.cardPad)
|
||||
.backgroundColor(FbColors.surface)
|
||||
.borderRadius(FbMetric.radius)
|
||||
|
||||
@@ -77,7 +77,6 @@ export struct FbMoviesPage {
|
||||
.layoutWeight(1)
|
||||
.maxLines(1)
|
||||
}
|
||||
.width('100%')
|
||||
.height(36)
|
||||
.padding({ left: 12, right: 12 })
|
||||
.backgroundColor(FbColors.inputBg)
|
||||
|
||||
@@ -293,7 +293,6 @@ export struct FbPeoplePage {
|
||||
}
|
||||
.width('100%')
|
||||
}
|
||||
.width('100%')
|
||||
.padding(FbMetric.cardPad)
|
||||
.backgroundColor(FbColors.surface)
|
||||
.borderRadius(FbMetric.radius)
|
||||
@@ -361,7 +360,6 @@ export struct FbPeoplePage {
|
||||
.width('100%')
|
||||
}
|
||||
}
|
||||
.width('100%')
|
||||
.padding(FbMetric.cardPad)
|
||||
.backgroundColor(FbColors.surface)
|
||||
.borderRadius(FbMetric.radius)
|
||||
|
||||
@@ -69,7 +69,6 @@ export struct FbSettingsPage {
|
||||
.renderMode(ImageRenderMode.Template)
|
||||
.fillColor(FbColors.faint)
|
||||
}
|
||||
.width('100%')
|
||||
.padding(FbMetric.cardPad)
|
||||
.backgroundColor(FbColors.surface)
|
||||
.borderRadius(FbMetric.radius)
|
||||
@@ -82,7 +81,6 @@ export struct FbSettingsPage {
|
||||
this.switchRow('到期提醒', '日程开始前 10 分钟提醒', true)
|
||||
this.switchRow('逾期提醒', '任务逾期时提醒我', true)
|
||||
}
|
||||
.width('100%')
|
||||
.padding(FbMetric.cardPad)
|
||||
.backgroundColor(FbColors.surface)
|
||||
.borderRadius(FbMetric.radius)
|
||||
@@ -113,7 +111,6 @@ export struct FbSettingsPage {
|
||||
this.moduleToggleRow(m)
|
||||
}, (m: FbModuleDef): string => 'set_' + m.key)
|
||||
}
|
||||
.width('100%')
|
||||
.padding(FbMetric.cardPad)
|
||||
.backgroundColor(FbColors.surface)
|
||||
.borderRadius(FbMetric.radius)
|
||||
@@ -137,7 +134,6 @@ export struct FbSettingsPage {
|
||||
this.colorRow(m)
|
||||
}, (m: FbModuleDef): string => 'col_' + m.key)
|
||||
}
|
||||
.width('100%')
|
||||
.padding(FbMetric.cardPad)
|
||||
.backgroundColor(FbColors.surface)
|
||||
.borderRadius(FbMetric.radius)
|
||||
@@ -151,7 +147,6 @@ export struct FbSettingsPage {
|
||||
this.plainRow('数据来源', '待接入 · 当前为演示数据')
|
||||
this.plainRow('服务器', '未配置')
|
||||
}
|
||||
.width('100%')
|
||||
.padding(FbMetric.cardPad)
|
||||
.backgroundColor(FbColors.surface)
|
||||
.borderRadius(FbMetric.radius)
|
||||
|
||||
Reference in New Issue
Block a user