Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a1f41ca9d | ||
|
|
4a648669ea | ||
|
|
60fd3d1044 | ||
|
|
ed7927af1d | ||
|
|
2d999edc0c | ||
|
|
4e062923ef |
29
CHANGELOG.md
29
CHANGELOG.md
@@ -1,5 +1,34 @@
|
||||
# 变更记录
|
||||
|
||||
## 2026-11-30 · 删除 CountdownFit,竖屏恢复 v2.3 行为(v2.7)
|
||||
|
||||
- 起因:用户报告竖屏专注时间变小(回归)。v2.6 的 CountdownFit 等宽缩号在锁屏页与悬浮窗两条链路都接入,竖屏被波及——该工具只要倒计时文字比时钟宽几像素(鸿蒙字体数字非严格等宽时必然发生)就缩小倒计时,前提错误。
|
||||
- 处理(回退):LockScreenActivity.kt、LockOverlay.kt 从 v2.3 提交 2dd7f8b 原样恢复(md5 校验一致);删除 util/CountdownFit.kt。
|
||||
- 全量比对:app/src 树与 v2.3 完全一致,仅 SettingsFragment.kt 版本号字符串不同;横竖屏布局 XML 本轮零改动。
|
||||
- 版本:versionCode 51 / versionName 2.7(Android 禁止 versionCode 降级,无法回退到 45),签名 SHA-256 7bcbd511…cc8c83 不变,直接覆盖安装,无数据迁移。装上后锁屏/悬浮窗行为与确认正常的 v2.3 一致。
|
||||
- 横屏线与左右数字的间距问题本轮未动,待截图实测后另行处理。
|
||||
|
||||
## 2026-11-30 · 回退 v2.3 布局基线 + 倒计时等宽缩号(v2.6)
|
||||
|
||||
- 起因:v2.5 的 autoSize 方案在锁屏/悬浮窗特殊窗口上渲染异常(时间缩小居中、高度只显示约三分之一),判定 autoSize 在该链路不可靠,彻底放弃。按用户要求回退到 v2.3(确认"高度对齐成功"的版本)重新修。
|
||||
- 回退:layout-land 布局从 git 提交 2dd7f8b 原样恢复,撤销 v2.4/v2.5 全部布局改动(贴线边距、match_parent、autoSize、tnum、gravity end/start)。
|
||||
- 重新修「右边距离比左边大」:唯一来源是倒计时 ≥100 分钟时为 6 位数(120:00),比右侧时钟宽出一个数字。新增 util/CountdownFit:按实际字体测量(Paint.measureText)把 6 位倒计时缩到与时钟完全等宽,居中布局下左右间隙天然相等;回到 5 位立即恢复 130sp(越大越好不变)。LockScreenActivity 与 LockOverlay 两条渲染链路同时接入。
|
||||
- 竖向对齐不受影响:时间列「时间+10dp+小字」整体居中,时间垂直中心=列中心−(10dp+小字)/2 与字号无关;中列锚点保持 130sp。
|
||||
- 版本号不回退(Android 不允许 versionCode 降级覆盖安装):2.6 / versionCode 50。
|
||||
- 改动文件:layout-land/activity_lock_screen.xml(恢复 v2.3)、LockScreenActivity.kt、LockOverlay.kt、util/CountdownFit.kt(新增)、build.gradle.kts、build.sh、SettingsFragment.kt。
|
||||
- 本地验证:构建通过,aapt2 确认 versionCode 50 / versionName 2.6,签名 SHA-256 7bcbd511…cc8c83 不变。
|
||||
- 升级说明:直接覆盖安装(可覆盖 v2.4/v2.5),无数据迁移。
|
||||
|
||||
## 2026-11-30 · 分割线左右等距 + autoSize 防溢出(v2.5)
|
||||
|
||||
- 起因:v2.4 后用户反馈「距离没变、一个屏幕装不下、需要左右滑动才能完整显示两个时间」。
|
||||
- 根因(本轮钉死):倒计时 ≥100 分钟时是 6 位数(如 120:00),130sp 下宽约 410dp,超出半屏可用宽度(约 366dp);wrap_content 被压缩后文字从框左缘起画、向右溢出越过分割线——左边贴死/越线、右边 24dp,即「右边距离比左边大 + 装不下」。
|
||||
- 方案:两个大时间改 match_parent 定宽 + autoSize 自动缩号(40sp..130sp)。5 位数保持 130sp 原样(「越大越好」不变);6 位数缩到刚好装下,永不溢出;文字 end/start 对齐 → 线到两边时间间隙恒为 24dp。时间列「时间+10dp+小字」整体居中,时间垂直中心=列中心−(10dp+小字)/2 与字号无关 → 一侧缩号不破坏竖向对齐。
|
||||
- 视觉变化:时间从「半屏居中」改为「贴线排布」,文字向外生长,与线的距离恒定;≥100 分钟时倒计时一侧字号自动略小。
|
||||
- 改动文件:layout-land/activity_lock_screen.xml、build.gradle.kts、build.sh、SettingsFragment.kt。
|
||||
- 本地验证:构建通过,aapt2 确认 versionCode 49 / versionName 2.5,签名 SHA-256 7bcbd511…cc8c83 不变。
|
||||
- 升级说明:直接覆盖安装,无数据迁移。
|
||||
|
||||
## 2026-11-30 · 分割线左右等距 + 等宽数字(v2.4)
|
||||
|
||||
- 起因:v2.3 垂直对齐成功后,用户反馈线到左右两边时间的水平间隙不相等。
|
||||
|
||||
@@ -539,6 +539,6 @@ class SettingsFragment : Fragment(R.layout.fragment_settings) {
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val VERSION = "2.4"
|
||||
const val VERSION = "2.7"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,13 +16,6 @@
|
||||
v2.3 改为中列完整镜像左右两栏(时间锚点 + 同规格小字占位),三列同高同顶,
|
||||
锚点中心严格等于时间文字中心;纯静态 XML,不受锁屏/悬浮窗特殊窗口运行时
|
||||
调整失效问题影响,字体缩放变化也同步。
|
||||
|
||||
v2.4 左右等距:v2.3 后用户反馈线到两边时间的左右间隙不相等。实测 Roboto
|
||||
数字等宽且布局对称,间隙不等只可能来自系统字体(鸿蒙 HarmonyOS Sans)
|
||||
数字非等宽,或倒计时 ≥100 分钟时多出一位。对策:①左栏改右对齐、右栏改
|
||||
左对齐,各距分割线固定 24dp——布局间隙无条件相等,不依赖文字宽度;
|
||||
②两侧大时间与锚点加 fontFeatureSettings=tnum,系统字体支持时强制数字
|
||||
等宽,连墨迹抖动也消除(不支持时无副作用)。
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/lockRoot"
|
||||
@@ -34,22 +27,18 @@
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 左:倒计时 + 任务名(右对齐贴线:右缘距分割线固定 24dp,
|
||||
与右栏对称,保证线到两边时间的布局间隙恒相等,
|
||||
不依赖两侧文字宽度恰好相同——鸿蒙系统字体数字非等宽时也成立) -->
|
||||
<!-- 左:倒计时 + 任务名 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical|end"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLockCountdown"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:fontFeatureSettings="tnum"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="130sp"
|
||||
@@ -60,7 +49,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:ellipsize="end"
|
||||
android:maxWidth="320dp"
|
||||
android:maxLines="1"
|
||||
@@ -84,16 +72,15 @@
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFeatureSettings="tnum"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:visibility="invisible"
|
||||
android:text="00:00"
|
||||
android:textSize="130sp"
|
||||
android:textStyle="bold" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:visibility="invisible"
|
||||
android:text="00:00"
|
||||
android:textSize="130sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<View
|
||||
android:id="@+id/lockDivider"
|
||||
@@ -113,21 +100,18 @@
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 右:时钟(大)+ 日期星期在时钟下面(左对齐贴线:左缘距分割线固定 24dp,
|
||||
与左栏对称;tnum 强制等宽数字,系统字体支持时两侧宽度恒等、不再抖动) -->
|
||||
<!-- 右:时钟(大)+ 日期星期在时钟下面 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical|start"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLockClock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:fontFeatureSettings="tnum"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="130sp"
|
||||
@@ -138,7 +122,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:textColor="#99FFFFFF"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user