Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d8995ead0 | ||
|
|
4444b18b29 | ||
|
|
11dc2825cc | ||
|
|
2dd7f8b506 | ||
|
|
3277fa5826 | ||
|
|
00a01b3f22 | ||
|
|
01ca852b2a | ||
|
|
8e7de267a4 | ||
|
|
9305bd588b | ||
|
|
77319b30da | ||
|
|
8694908305 | ||
|
|
5b58596727 | ||
|
|
7762e463d6 |
55
CHANGELOG.md
55
CHANGELOG.md
@@ -1,8 +1,59 @@
|
|||||||
# 变更记录
|
# 变更记录
|
||||||
|
|
||||||
## 2026-11-30 · 分割线改fontMetrics直接计算修复消失;删除线按墨迹中点自绘居中;置顶圆圈粗细与底部对齐调整,版本 1.8
|
## 2026-11-30 · 分割线左右等距 + 等宽数字(v2.4)
|
||||||
|
|
||||||
- 同步源码更新 4 个文件(新增/修改 4,删除 0)。
|
- 起因:v2.3 垂直对齐成功后,用户反馈线到左右两边时间的水平间隙不相等。
|
||||||
|
- 诊断(实测而非猜测):布局左右两栏 weight 严格对称,分割线恒在正中;下载 Roboto-Bold 解析 hmtx 并用 Pillow 复核,10 个数字 advance 全部 0.5737em(等宽),`DD:DD` 恒等于 2.5771em。间隙不等只能来自系统字体(鸿蒙 HarmonyOS Sans 数字非等宽)或倒计时 ≥100 分钟时的 6 位(3.1509em)。
|
||||||
|
- 方案双保险:①左栏右对齐 + marginEnd 24dp、右栏左对齐 + marginStart 24dp——线到两边时间的布局间隙无条件恒等;②两侧大时间与锚点加 `fontFeatureSettings="tnum"`,系统字体支持时强制数字等宽、消除逐秒抖动(不支持则无副作用)。
|
||||||
|
- 视觉变化:时间从「半屏居中」改为「贴线排布」,文字向外生长,与线的距离恒定。
|
||||||
|
- 改动文件:layout-land/activity_lock_screen.xml、build.gradle.kts、build.sh、SettingsFragment.kt。
|
||||||
|
- 本地验证:构建通过,aapt2 确认 versionCode 48 / versionName 2.4,签名 SHA-256 7bcbd511…cc8c83 不变。
|
||||||
|
- 升级说明:直接覆盖安装,无数据迁移。
|
||||||
|
|
||||||
|
## 2026-11-30 · 分割线中列完整镜像,真正与时间上下对齐(v2.3)
|
||||||
|
|
||||||
|
- 起因:v2.2 修复无效——锚点 FrameLayout 与左右两栏同被 `center_vertical` 居中,但锚点列只有时间高(T),侧栏多出「10dp+15sp 小字」(C>T),高度不同的列各自居中后顶不对齐,锚点中心仍落在屏幕中心,与旧版位置完全相同。
|
||||||
|
- 方案:中列完整镜像左右两栏——`vertical LinearLayout` 内①1dp FrameLayout(130sp 粗体不可见锚点文字 + center 分割线)②与侧栏同规格(15sp、marginTop 10dp)的不可见小字占位。三列同高同顶,锚点中心严格等于时间中心。锚点文字加 `maxLines=1`,防止 1dp 宽父容器把 "00:00" 折行撑高。
|
||||||
|
- 纯静态 XML,锁屏/悬浮窗两条链路同时生效;字体缩放同步。
|
||||||
|
- 改动文件:layout-land/activity_lock_screen.xml、build.gradle.kts、build.sh、SettingsFragment.kt。
|
||||||
|
- 本地验证:构建通过,aapt 确认 versionCode 47 / versionName 2.3,签名 SHA-256 7bcbd511…cc8c83 不变。
|
||||||
|
- 升级说明:直接覆盖安装,无数据迁移。
|
||||||
|
|
||||||
|
## 2026-11-30 · 横屏分割线与时间上下精确对齐(v2.2)
|
||||||
|
|
||||||
|
- 起因:用户反馈分割线高度已与左右时间一致,但位置偏下、底部超出时间墨迹边线。
|
||||||
|
- 根因:分割线是横排 `center_vertical` LinearLayout 的直系子 View,居中基准是整个左右两栏(时间 + 10dp 间距 + 15sp 小字),下方多出的一截把线中心下拉约 15dp。
|
||||||
|
- 方案:镜像锚点——分割线外套 1dp 宽 FrameLayout,内放与左右时间同规格(130sp 粗体、includeFontPadding=false)的不可见占位文字,分割线在其中 center 对齐;线中心严格等于时间文字中心。纯静态 XML,不受锁屏/悬浮窗特殊窗口运行时布局失效问题影响,字体缩放变化也同步。悬浮窗复用同一布局,两条链路同时生效。
|
||||||
|
- 改动文件:layout-land/activity_lock_screen.xml、build.gradle.kts、build.sh、SettingsFragment.kt。
|
||||||
|
- 本地验证:构建通过,aapt 确认 versionCode 46 / versionName 2.2,签名 SHA-256 7bcbd511…cc8c83 不变。
|
||||||
|
- 升级说明:直接覆盖安装,无数据迁移。
|
||||||
|
|
||||||
|
## 2026-11-30 · 分割线降至与时间等高 + 改项目迁移关联任务 + 重要紧急排序(v2.1)
|
||||||
|
|
||||||
|
- 分割线:150dp 偏高,降到 92dp(≈130sp 粗体数字字面高度 0.71em×130),与左右时间视觉等高。
|
||||||
|
- 改项目重复 bug:编辑已有任务换项目时,只有当前行更新了 project_id,而周期系列的其他实例(origin_id=根id)和完成记录副本(origin_id=实例id)都还复制着旧项目,导致新旧项目各显示一份同名任务。现在 updateTask 检测到项目变化时,把根任务、系列实例、实例的完成记录副本一起迁移到新项目(带旧项目条件保证幂等);编辑完成记录副本本身则只移动该行、不牵连源任务。
|
||||||
|
- 普通任务排序:改为按重要度+紧急度总分降序(各 0低/1中/2高,总分 4→0 对应:最重要最紧急 → 最重要或最紧急 → 中重要中紧急 → 中重要或中紧急 → 低低),同分内再按有截止日优先/截止日升序/创建先后。置顶、逾期分组保持在前不变。
|
||||||
|
- 改动文件:layout-land/activity_lock_screen.xml、Store.kt、build.gradle.kts、build.sh、SettingsFragment.kt。
|
||||||
|
- 本地验证:构建通过,aapt 确认 versionCode 45 / versionName 2.1,签名 SHA-256 7bcbd511…cc8c83 不变。
|
||||||
|
- 升级说明:直接覆盖安装,无数据迁移。
|
||||||
|
|
||||||
|
## 2026-11-30 · 分割线恢复原始可见实现 + 逾期任务置顶后优先(v2.0)
|
||||||
|
|
||||||
|
- 起因:v1.9 分割线仍不可见(match_parent 结构化方案也失效);用户确认最初静态 View 方案可见,要求恢复原实现只调高度;另要求逾期任务排在列表前面、置顶之后。
|
||||||
|
- 分割线方案:横屏布局整体恢复最初可见版本的原始结构——静态 View(1dp 宽)直接放在左右两栏之间,固定 150dp 高(≈130sp 时间文字墨迹高度 1.17×130sp,仅分割时间不盖下方文字),零运行时代码。
|
||||||
|
- 逾期排序:Store.tasks 的 ORDER BY 增加逾期分组层,未完成任务顺序变为:①随时置顶 ②已逾期(due>0 且 due<今天0点,阈值由 Dates.todayStart() 在查询时算好)③其余按截止日/优先级不变;逾期只提升位置,组内顺序不变。
|
||||||
|
- 改动文件:layout-land/activity_lock_screen.xml、Store.kt、build.gradle.kts、build.sh、SettingsFragment.kt。
|
||||||
|
- 本地验证:构建通过,aapt 确认 versionCode 44 / versionName 2.0,签名 SHA-256 7bcbd511…cc8c83 不变。
|
||||||
|
- 升级说明:直接覆盖安装,无数据迁移。
|
||||||
|
|
||||||
|
## 2026-11-30 · 横屏分割线结构化对齐(v1.9)
|
||||||
|
|
||||||
|
- 起因:分割线高度连续两版用「运行时改 LayoutParams」(View.post / fontMetrics 计算后 requestLayout)都在锁屏/悬浮窗链路上失效,线不显示。
|
||||||
|
- 根因:运行时改高度依赖布局系统对特殊窗口的重新布局,链路不可靠。
|
||||||
|
- 方案:改为纯 XML 结构约束——横屏布局重排为上下两行:上行「倒计时 | 分割线 | 时钟」同行排布,分割线 layout_height=match_parent 直接继承行高(行高即 130sp 时间文字高度);下行「任务名 | 占位 | 日期」与上行两栏逐列对齐。删除 Activity 与 LockOverlay 里的 syncDivider 代码,零运行时逻辑。
|
||||||
|
- 改动文件:layout-land/activity_lock_screen.xml、LockScreenActivity.kt、LockOverlay.kt、build.gradle.kts、build.sh、SettingsFragment.kt。
|
||||||
|
- 本地验证:构建通过,aapt 确认 versionCode 43 / versionName 1.9,签名 SHA-256 7bcbd511…cc8c83 不变。
|
||||||
|
- 升级说明:直接覆盖安装,无数据迁移。
|
||||||
|
|
||||||
## 2026-11-29 · 分割线算法化/删除线居中/置顶图标对齐(v1.8)
|
## 2026-11-29 · 分割线算法化/删除线居中/置顶图标对齐(v1.8)
|
||||||
|
|
||||||
|
|||||||
@@ -249,12 +249,17 @@ object Store {
|
|||||||
args.add(projectId.toString())
|
args.add(projectId.toString())
|
||||||
}
|
}
|
||||||
if (!includeDone) where.append(" AND done = 0")
|
if (!includeDone) where.append(" AND done = 0")
|
||||||
// 已完成的按完成时间倒序(最近做完的排前面),未完成的按截止/优先级;
|
// 已完成的按完成时间倒序(最近做完的排前面)。未完成分组依次是:
|
||||||
// 「随时」任务(repeat_type=4)排到未完成最前面,随时可以开始
|
// ①「随时」置顶(repeat_type=4)②已逾期(有截止日且早于今天 0 点)
|
||||||
|
// ③普通任务按重要+紧急总分排(各 0低/1中/2高:4=最重要最紧急、3=最重要或
|
||||||
|
// 最紧急、2=中重要中紧急、1=中重要或中紧急、0=低低),同分再按截止日/先后
|
||||||
|
val todayStart = com.focusbox.app.util.Dates.todayStart()
|
||||||
val sql = "SELECT $taskColumns FROM tasks WHERE $where " +
|
val sql = "SELECT $taskColumns FROM tasks WHERE $where " +
|
||||||
"ORDER BY done ASC, CASE WHEN done = 1 THEN done_at ELSE 0 END DESC, " +
|
"ORDER BY done ASC, CASE WHEN done = 1 THEN done_at ELSE 0 END DESC, " +
|
||||||
"CASE WHEN done = 0 AND repeat_type = ${Repeat.ANYTIME} THEN 0 ELSE 1 END ASC, " +
|
"CASE WHEN done = 0 AND repeat_type = ${Repeat.ANYTIME} THEN 0 ELSE 1 END ASC, " +
|
||||||
"CASE WHEN due = 0 THEN 1 ELSE 0 END ASC, due ASC, priority DESC, _id DESC"
|
"CASE WHEN done = 0 AND due > 0 AND due < $todayStart THEN 0 ELSE 1 END ASC, " +
|
||||||
|
"CASE WHEN done = 0 THEN priority + urgency ELSE 0 END DESC, " +
|
||||||
|
"CASE WHEN due = 0 THEN 1 ELSE 0 END ASC, due ASC, _id DESC"
|
||||||
val list = ArrayList<Task>()
|
val list = ArrayList<Task>()
|
||||||
db.rawQuery(sql, args.toTypedArray()).use { c ->
|
db.rawQuery(sql, args.toTypedArray()).use { c ->
|
||||||
while (c.moveToNext()) list.add(cursorToTask(c))
|
while (c.moveToNext()) list.add(cursorToTask(c))
|
||||||
@@ -300,6 +305,8 @@ object Store {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun updateTask(task: Task) {
|
fun updateTask(task: Task) {
|
||||||
|
// 改动前先取旧行:判断项目是否变化、以及该行是不是"完成记录副本"
|
||||||
|
val old = task(task.id)
|
||||||
val cv = ContentValues().apply {
|
val cv = ContentValues().apply {
|
||||||
put("title", task.title)
|
put("title", task.title)
|
||||||
put("note", task.note)
|
put("note", task.note)
|
||||||
@@ -313,6 +320,20 @@ object Store {
|
|||||||
put("repeat_every", task.repeatEvery.coerceAtLeast(1))
|
put("repeat_every", task.repeatEvery.coerceAtLeast(1))
|
||||||
}
|
}
|
||||||
db.update("tasks", cv, "_id = ?", arrayOf(task.id.toString()))
|
db.update("tasks", cv, "_id = ?", arrayOf(task.id.toString()))
|
||||||
|
// 项目变了 → 关联行一起迁移,否则旧项目会残留同名任务:
|
||||||
|
// 周期系列的其他实例(origin_id=根id)和完成记录副本(origin_id=实例id)
|
||||||
|
// 都是创建时从当前行复制的旧项目。完成记录副本本身被编辑时不牵连源任务。
|
||||||
|
if (old != null && old.projectId != task.projectId &&
|
||||||
|
!(old.done && old.repeatType == Repeat.NONE && old.originId > 0)
|
||||||
|
) {
|
||||||
|
val root = if (old.originId > 0) old.originId else old.id
|
||||||
|
db.execSQL(
|
||||||
|
"UPDATE tasks SET project_id = ? WHERE project_id = ? AND (" +
|
||||||
|
"_id = ? OR origin_id = ? OR " +
|
||||||
|
"origin_id IN (SELECT _id FROM tasks WHERE origin_id = ?))",
|
||||||
|
arrayOf(task.projectId, old.projectId, root, root, root),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -137,30 +137,11 @@ object LockOverlay {
|
|||||||
view.findViewById<TextView>(R.id.tvLockClock)?.text = clockFmt.format(cal.time)
|
view.findViewById<TextView>(R.id.tvLockClock)?.text = clockFmt.format(cal.time)
|
||||||
view.findViewById<TextView>(R.id.tvLockCountdown)?.text = Dates.clock(now)
|
view.findViewById<TextView>(R.id.tvLockCountdown)?.text = Dates.clock(now)
|
||||||
|
|
||||||
syncDivider(view)
|
|
||||||
|
|
||||||
val task = if (TimerCore.taskId > 0) Store.task(TimerCore.taskId)?.title else null
|
val task = if (TimerCore.taskId > 0) Store.task(TimerCore.taskId)?.title else null
|
||||||
view.findViewById<TextView>(R.id.tvLockTask)?.text =
|
view.findViewById<TextView>(R.id.tvLockTask)?.text =
|
||||||
task?.takeIf { it.isNotBlank() } ?: view.context.getString(R.string.notif_no_task)
|
task?.takeIf { it.isNotBlank() } ?: view.context.getString(R.string.notif_no_task)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 横屏排版里的分割线只分割两块大时间:高度直接由 paint.fontMetrics 算出
|
|
||||||
* (includeFontPadding=false 时 TextView 高度就是 ascent..descent 跨度),
|
|
||||||
* 不依赖布局完成时机——上一版 View.post 在悬浮窗链路上时序不稳导致线消失。
|
|
||||||
* 竖屏布局没有这个控件,查找结果为 null 直接跳过。
|
|
||||||
*/
|
|
||||||
private fun syncDivider(view: View) {
|
|
||||||
val divider = view.findViewById<View>(R.id.lockDivider) ?: return
|
|
||||||
val countdown = view.findViewById<TextView>(R.id.tvLockCountdown) ?: return
|
|
||||||
val fm = countdown.paint.fontMetrics
|
|
||||||
val h = (fm.descent - fm.ascent).toInt()
|
|
||||||
if (h > 0 && divider.layoutParams != null && divider.layoutParams.height != h) {
|
|
||||||
divider.layoutParams.height = h
|
|
||||||
divider.requestLayout()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Calendar 的 DAY_OF_WEEK(周日=1)转成 weekdayShort 的下标(周一=0 … 周日=6) */
|
/** Calendar 的 DAY_OF_WEEK(周日=1)转成 weekdayShort 的下标(周一=0 … 周日=6) */
|
||||||
private fun weekdayIndex(cal: Calendar): Int = (cal.get(Calendar.DAY_OF_WEEK) + 5) % 7
|
private fun weekdayIndex(cal: Calendar): Int = (cal.get(Calendar.DAY_OF_WEEK) + 5) % 7
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -156,29 +156,10 @@ class LockScreenActivity : AppCompatActivity() {
|
|||||||
tvClock.text = clockFmt.format(cal.time)
|
tvClock.text = clockFmt.format(cal.time)
|
||||||
tvCountdown.text = Dates.clock(now)
|
tvCountdown.text = Dates.clock(now)
|
||||||
|
|
||||||
syncDivider()
|
|
||||||
|
|
||||||
val task = if (TimerCore.taskId > 0) Store.task(TimerCore.taskId)?.title else null
|
val task = if (TimerCore.taskId > 0) Store.task(TimerCore.taskId)?.title else null
|
||||||
tvTask.text = task?.takeIf { it.isNotBlank() } ?: getString(R.string.notif_no_task)
|
tvTask.text = task?.takeIf { it.isNotBlank() } ?: getString(R.string.notif_no_task)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 横屏排版里的分割线只分割两块大时间,高度对齐倒计时文字的实际渲染高度。
|
|
||||||
* 上一版用 View.post 等布局完成后再取 height,实测在悬浮窗/锁屏链路上
|
|
||||||
* 时机不稳导致分割线整条消失;这里改为直接由 paint.fontMetrics 算出
|
|
||||||
* (includeFontPadding=false 时 TextView 高度就是 ascent..descent 跨度),
|
|
||||||
* 零时序依赖、立即生效。竖屏布局没有这个控件,查找结果为 null 直接跳过。
|
|
||||||
*/
|
|
||||||
private fun syncDivider() {
|
|
||||||
val divider = findViewById<View>(R.id.lockDivider) ?: return
|
|
||||||
val fm = tvCountdown.paint.fontMetrics
|
|
||||||
val h = (fm.descent - fm.ascent).toInt()
|
|
||||||
if (h > 0 && divider.layoutParams != null && divider.layoutParams.height != h) {
|
|
||||||
divider.layoutParams.height = h
|
|
||||||
divider.requestLayout()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Calendar 的 DAY_OF_WEEK(周日=1)转成 weekdayShort 的下标(周一=0 … 周日=6) */
|
/** Calendar 的 DAY_OF_WEEK(周日=1)转成 weekdayShort 的下标(周一=0 … 周日=6) */
|
||||||
private fun weekdayIndex(cal: Calendar): Int = (cal.get(Calendar.DAY_OF_WEEK) + 5) % 7
|
private fun weekdayIndex(cal: Calendar): Int = (cal.get(Calendar.DAY_OF_WEEK) + 5) % 7
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -539,6 +539,6 @@ class SettingsFragment : Fragment(R.layout.fragment_settings) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val VERSION = "1.8"
|
const val VERSION = "2.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,28 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
锁屏全屏倒计时·横屏专属排版(区别于竖屏的纯纵向堆叠):
|
锁屏全屏倒计时·横屏专属排版(区别于竖屏的纯纵向堆叠):
|
||||||
左右对称分栏 —— 左侧倒计时(大)+ 任务名,右侧时钟(大)+ 日期星期,
|
左右对称分栏——左侧倒计时(大)+ 任务名,右侧时钟(大)+ 日期星期,
|
||||||
两侧主字号统一 96sp,视觉左右对应;无「工作中/休息中」提示。
|
两侧主字号统一 130sp,视觉左右对应;无「工作中/休息中」提示。
|
||||||
|
|
||||||
|
分割线:保持最初可见版本的原始实现——静态 View 直接放在两栏之间,
|
||||||
|
固定 dp 高度,无任何运行时改动(此前的 View.post / fontMetrics /
|
||||||
|
match_parent 结构化三版方案在锁屏/悬浮窗链路上全部失效)。
|
||||||
|
高度 150dp ≈ 130sp 时间文字的墨迹高度(1.17 × 130sp),仅分割两块大时间。
|
||||||
|
|
||||||
|
v2.2/v2.3 位置对齐:分割线作为横排直系子 View 时,center_vertical 相对「整个
|
||||||
|
左右两栏(时间+10dp间距+15sp小字)」居中,下方多出的一截把线的中心往下拉。
|
||||||
|
v2.2 只在分割线外套锚点 FrameLayout,但锚点列比侧栏矮(没有补小字占位),
|
||||||
|
三列各自居中后锚点中心仍落在屏幕中心,位置不变、修复无效。
|
||||||
|
v2.3 改为中列完整镜像左右两栏(时间锚点 + 同规格小字占位),三列同高同顶,
|
||||||
|
锚点中心严格等于时间文字中心;纯静态 XML,不受锁屏/悬浮窗特殊窗口运行时
|
||||||
|
调整失效问题影响,字体缩放变化也同步。
|
||||||
|
|
||||||
|
v2.4 左右等距:v2.3 后用户反馈线到两边时间的左右间隙不相等。实测 Roboto
|
||||||
|
数字等宽且布局对称,间隙不等只可能来自系统字体(鸿蒙 HarmonyOS Sans)
|
||||||
|
数字非等宽,或倒计时 ≥100 分钟时多出一位。对策:①左栏改右对齐、右栏改
|
||||||
|
左对齐,各距分割线固定 24dp——布局间隙无条件相等,不依赖文字宽度;
|
||||||
|
②两侧大时间与锚点加 fontFeatureSettings=tnum,系统字体支持时强制数字
|
||||||
|
等宽,连墨迹抖动也消除(不支持时无副作用)。
|
||||||
-->
|
-->
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/lockRoot"
|
android:id="@+id/lockRoot"
|
||||||
@@ -14,18 +34,22 @@
|
|||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<!-- 左:倒计时 + 任务名 -->
|
<!-- 左:倒计时 + 任务名(右对齐贴线:右缘距分割线固定 24dp,
|
||||||
|
与右栏对称,保证线到两边时间的布局间隙恒相等,
|
||||||
|
不依赖两侧文字宽度恰好相同——鸿蒙系统字体数字非等宽时也成立) -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="center"
|
android:gravity="center_vertical|end"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvLockCountdown"
|
android:id="@+id/tvLockCountdown"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:fontFeatureSettings="tnum"
|
||||||
android:includeFontPadding="false"
|
android:includeFontPadding="false"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="130sp"
|
android:textSize="130sp"
|
||||||
@@ -36,6 +60,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxWidth="320dp"
|
android:maxWidth="320dp"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
@@ -43,25 +68,66 @@
|
|||||||
android:textSize="15sp" />
|
android:textSize="15sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- 中:细分隔线(只分割两块大时间,高度运行时对齐倒计时文字的实际高度) -->
|
<!-- 中:细分隔线(92dp≈130sp 粗体数字的字面高度 0.71em×130,与时间视觉等高)
|
||||||
<View
|
v2.3 中列完整镜像左右两栏:上方 1dp FrameLayout 内放与时间同规格的 130sp
|
||||||
android:id="@+id/lockDivider"
|
不可见锚点文字(maxLines=1,防止 1dp 宽度触发折行撑高),分割线在其中
|
||||||
android:layout_width="1dp"
|
center;下方补一段与侧栏小字同规格(15sp、marginTop 10dp)的不可见占位,
|
||||||
android:layout_height="180dp"
|
使中列总高与左右两栏一致。三列同高且都被 center_vertical 居中 → 同顶,
|
||||||
android:background="#26FFFFFF" />
|
锚点中心严格等于时间文字中心。(v2.2 只放了锚点没补占位,中列比侧栏矮
|
||||||
|
一截,居中后中心仍落在屏幕中心,与旧版位置相同,故无效) -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<!-- 右:时钟(大)+ 日期星期在时钟下面 -->
|
<FrameLayout
|
||||||
|
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" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/lockDivider"
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="92dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:background="#26FFFFFF" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:visibility="invisible"
|
||||||
|
android:text="0"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 右:时钟(大)+ 日期星期在时钟下面(左对齐贴线:左缘距分割线固定 24dp,
|
||||||
|
与左栏对称;tnum 强制等宽数字,系统字体支持时两侧宽度恒等、不再抖动) -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="center"
|
android:gravity="center_vertical|start"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvLockClock"
|
android:id="@+id/tvLockClock"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:fontFeatureSettings="tnum"
|
||||||
android:includeFontPadding="false"
|
android:includeFontPadding="false"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="130sp"
|
android:textSize="130sp"
|
||||||
@@ -72,6 +138,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
android:textColor="#99FFFFFF"
|
android:textColor="#99FFFFFF"
|
||||||
android:textSize="15sp" />
|
android:textSize="15sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
Reference in New Issue
Block a user