Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d999edc0c | ||
|
|
4e062923ef | ||
|
|
7d8995ead0 | ||
|
|
4444b18b29 | ||
|
|
11dc2825cc | ||
|
|
2dd7f8b506 | ||
|
|
3277fa5826 | ||
|
|
00a01b3f22 | ||
|
|
01ca852b2a | ||
|
|
8e7de267a4 | ||
|
|
9305bd588b | ||
|
|
77319b30da | ||
|
|
8694908305 |
56
CHANGELOG.md
56
CHANGELOG.md
@@ -1,8 +1,60 @@
|
|||||||
# 变更记录
|
# 变更记录
|
||||||
|
|
||||||
## 2026-11-30 · 横屏分割线改纯XML结构化对齐(match_parent继承时间行高),删除运行时高度代码,版本 1.9
|
## 2026-11-30 · 分割线左右等距 + autoSize 防溢出(v2.5)
|
||||||
|
|
||||||
- 同步源码更新 4 个文件(新增/修改 4,删除 0)。
|
- 起因: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 垂直对齐成功后,用户反馈线到左右两边时间的水平间隙不相等。
|
||||||
|
- 诊断(实测而非猜测):布局左右两栏 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)
|
## 2026-11-30 · 横屏分割线结构化对齐(v1.9)
|
||||||
|
|
||||||
|
|||||||
@@ -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),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -539,6 +539,6 @@ class SettingsFragment : Fragment(R.layout.fragment_settings) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val VERSION = "1.9"
|
const val VERSION = "2.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,28 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
锁屏全屏倒计时·横屏专属排版(区别于竖屏的纯纵向堆叠):
|
锁屏全屏倒计时·横屏专属排版(区别于竖屏的纯纵向堆叠):
|
||||||
上行是主行:倒计时 | 分割线 | 时钟,三者在同一行内,
|
左右对称分栏——左侧倒计时(大)+ 任务名,右侧时钟(大)+ 日期星期,
|
||||||
分割线高度用 match_parent 直接继承行高——行高由两侧 130sp 大时间撑起,
|
两侧主字号统一 130sp,视觉左右对应;无「工作中/休息中」提示。
|
||||||
所以线高天然与时间文字一致,纯 XML 结构保证,不依赖任何运行时代码
|
|
||||||
(此前两版运行时改高度的方案在锁屏/悬浮窗链路上都失效了)。
|
分割线:保持最初可见版本的原始实现——静态 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,74 +31,44 @@
|
|||||||
android:background="@android:color/black"
|
android:background="@android:color/black"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:gravity="center"
|
android:gravity="center_vertical"
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<!-- 上行:倒计时 | 分割线 | 时钟(分割线高度=本行高度=时间文字高度) -->
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<!-- 左:倒计时 + 任务名(右对齐贴线:右缘距分割线固定 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"
|
||||||
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_height="wrap_content"
|
|
||||||
android:includeFontPadding="false"
|
|
||||||
android:textColor="#FFFFFF"
|
|
||||||
android:textSize="130sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/lockDivider"
|
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="#26FFFFFF" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:gravity="center"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tvLockClock"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:includeFontPadding="false"
|
|
||||||
android:textColor="#FFFFFF"
|
|
||||||
android:textSize="130sp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- 下行:任务名 | 占位(与分割线同宽,保持两栏对齐) | 日期星期 -->
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginEnd="24dp"
|
||||||
android:orientation="horizontal">
|
android:autoSizeTextType="uniform"
|
||||||
|
android:autoSizeMinTextSize="40sp"
|
||||||
<LinearLayout
|
android:autoSizeMaxTextSize="130sp"
|
||||||
android:layout_width="0dp"
|
android:fontFeatureSettings="tnum"
|
||||||
android:layout_height="wrap_content"
|
android:gravity="center_vertical|end"
|
||||||
android:layout_weight="1"
|
android:includeFontPadding="false"
|
||||||
android:gravity="center"
|
android:textColor="#FFFFFF"
|
||||||
android:orientation="vertical">
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvLockTask"
|
android:id="@+id/tvLockTask"
|
||||||
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_marginEnd="24dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:maxWidth="320dp"
|
android:maxWidth="320dp"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
@@ -89,24 +76,83 @@
|
|||||||
android:textSize="15sp" />
|
android:textSize="15sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<View
|
<!-- 中:细分隔线(92dp≈130sp 粗体数字的字面高度 0.71em×130,与时间视觉等高)
|
||||||
android:layout_width="1dp"
|
v2.3 中列完整镜像左右两栏:上方 1dp FrameLayout 内放与时间同规格的 130sp
|
||||||
android:layout_height="match_parent" />
|
不可见锚点文字(maxLines=1,防止 1dp 宽度触发折行撑高),分割线在其中
|
||||||
|
center;下方补一段与侧栏小字同规格(15sp、marginTop 10dp)的不可见占位,
|
||||||
|
使中列总高与左右两栏一致。三列同高且都被 center_vertical 居中 → 同顶,
|
||||||
|
锚点中心严格等于时间文字中心。(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;
|
||||||
|
与左栏同样 match_parent 定宽 + autoSize,字体缩放变大或位数变多时
|
||||||
|
自动缩号,永不溢出屏幕) -->
|
||||||
<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
|
||||||
|
android:id="@+id/tvLockClock"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:autoSizeTextType="uniform"
|
||||||
|
android:autoSizeMinTextSize="40sp"
|
||||||
|
android:autoSizeMaxTextSize="130sp"
|
||||||
|
android:fontFeatureSettings="tnum"
|
||||||
|
android:gravity="center_vertical|start"
|
||||||
|
android:includeFontPadding="false"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvLockDate"
|
android:id="@+id/tvLockDate"
|
||||||
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_marginStart="24dp"
|
||||||
android:textColor="#99FFFFFF"
|
android:textColor="#99FFFFFF"
|
||||||
android:textSize="15sp" />
|
android:textSize="15sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
Reference in New Issue
Block a user