Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d999edc0c | ||
|
|
4e062923ef |
10
CHANGELOG.md
10
CHANGELOG.md
@@ -1,5 +1,15 @@
|
|||||||
# 变更记录
|
# 变更记录
|
||||||
|
|
||||||
|
## 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)
|
## 2026-11-30 · 分割线左右等距 + 等宽数字(v2.4)
|
||||||
|
|
||||||
- 起因:v2.3 垂直对齐成功后,用户反馈线到左右两边时间的水平间隙不相等。
|
- 起因:v2.3 垂直对齐成功后,用户反馈线到左右两边时间的水平间隙不相等。
|
||||||
|
|||||||
@@ -539,6 +539,6 @@ class SettingsFragment : Fragment(R.layout.fragment_settings) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val VERSION = "2.4"
|
const val VERSION = "2.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,8 +35,13 @@
|
|||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<!-- 左:倒计时 + 任务名(右对齐贴线:右缘距分割线固定 24dp,
|
<!-- 左:倒计时 + 任务名(右对齐贴线:右缘距分割线固定 24dp,
|
||||||
与右栏对称,保证线到两边时间的布局间隙恒相等,
|
与右栏对称,保证线到两边时间的布局间隙恒相等)
|
||||||
不依赖两侧文字宽度恰好相同——鸿蒙系统字体数字非等宽时也成立) -->
|
v2.5:倒计时 ≥100 分钟时是 6 位数(如 120:00),130sp 下宽约 410dp,
|
||||||
|
超出半屏可用宽度,wrap_content 会被压缩且文字从框左缘起画、越过分割线
|
||||||
|
——v2.4「装不下/越过线」的根因。改为 match_parent 定宽 + autoSize
|
||||||
|
自动缩号(上限仍 130sp):5 位数保持 130sp 原样,6 位数缩到刚好装下,
|
||||||
|
永不溢出。时间列结构「时间+10dp+小字」整体居中,时间中心=列中心
|
||||||
|
-(10+小字)/2,与字号无关 → 一侧缩号不破坏竖向对齐。 -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -46,13 +51,16 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvLockCountdown"
|
android:id="@+id/tvLockCountdown"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="24dp"
|
android:layout_marginEnd="24dp"
|
||||||
|
android:autoSizeTextType="uniform"
|
||||||
|
android:autoSizeMinTextSize="40sp"
|
||||||
|
android:autoSizeMaxTextSize="130sp"
|
||||||
android:fontFeatureSettings="tnum"
|
android:fontFeatureSettings="tnum"
|
||||||
|
android:gravity="center_vertical|end"
|
||||||
android:includeFontPadding="false"
|
android:includeFontPadding="false"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="130sp"
|
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -113,8 +121,9 @@
|
|||||||
android:textSize="15sp" />
|
android:textSize="15sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- 右:时钟(大)+ 日期星期在时钟下面(左对齐贴线:左缘距分割线固定 24dp,
|
<!-- 右:时钟(大)+ 日期星期在时钟下面(左对齐贴线:左缘距分割线固定 24dp;
|
||||||
与左栏对称;tnum 强制等宽数字,系统字体支持时两侧宽度恒等、不再抖动) -->
|
与左栏同样 match_parent 定宽 + autoSize,字体缩放变大或位数变多时
|
||||||
|
自动缩号,永不溢出屏幕) -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -124,13 +133,16 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvLockClock"
|
android:id="@+id/tvLockClock"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="24dp"
|
android:layout_marginStart="24dp"
|
||||||
|
android:autoSizeTextType="uniform"
|
||||||
|
android:autoSizeMinTextSize="40sp"
|
||||||
|
android:autoSizeMaxTextSize="130sp"
|
||||||
android:fontFeatureSettings="tnum"
|
android:fontFeatureSettings="tnum"
|
||||||
|
android:gravity="center_vertical|start"
|
||||||
android:includeFontPadding="false"
|
android:includeFontPadding="false"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="130sp"
|
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|||||||
Reference in New Issue
Block a user