Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77319b30da | ||
|
|
8694908305 |
13
CHANGELOG.md
13
CHANGELOG.md
@@ -1,8 +1,17 @@
|
||||
# 变更记录
|
||||
|
||||
## 2026-11-30 · 横屏分割线改纯XML结构化对齐(match_parent继承时间行高),删除运行时高度代码,版本 1.9
|
||||
## 2026-11-30 · 分割线恢复原始静态View实现高度150dp;逾期任务排在置顶之后列表最前,版本 2.0
|
||||
|
||||
- 同步源码更新 4 个文件(新增/修改 4,删除 0)。
|
||||
- 同步源码更新 3 个文件(新增/修改 3,删除 0)。
|
||||
|
||||
## 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)
|
||||
|
||||
|
||||
@@ -249,11 +249,14 @@ object Store {
|
||||
args.add(projectId.toString())
|
||||
}
|
||||
if (!includeDone) where.append(" AND done = 0")
|
||||
// 已完成的按完成时间倒序(最近做完的排前面),未完成的按截止/优先级;
|
||||
// 「随时」任务(repeat_type=4)排到未完成最前面,随时可以开始
|
||||
// 已完成的按完成时间倒序(最近做完的排前面)。未完成分组依次是:
|
||||
// ①「随时」置顶(repeat_type=4)②已逾期(有截止日且早于今天 0 点)
|
||||
// ③其余按截止日升序/优先级——逾期只提升位置,不改变组内原有顺序
|
||||
val todayStart = com.focusbox.app.util.Dates.todayStart()
|
||||
val sql = "SELECT $taskColumns FROM tasks WHERE $where " +
|
||||
"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 due > 0 AND due < $todayStart THEN 0 ELSE 1 END ASC, " +
|
||||
"CASE WHEN due = 0 THEN 1 ELSE 0 END ASC, due ASC, priority DESC, _id DESC"
|
||||
val list = ArrayList<Task>()
|
||||
db.rawQuery(sql, args.toTypedArray()).use { c ->
|
||||
|
||||
@@ -539,6 +539,6 @@ class SettingsFragment : Fragment(R.layout.fragment_settings) {
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val VERSION = "1.9"
|
||||
const val VERSION = "2.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
锁屏全屏倒计时·横屏专属排版(区别于竖屏的纯纵向堆叠):
|
||||
上行是主行:倒计时 | 分割线 | 时钟,三者在同一行内,
|
||||
分割线高度用 match_parent 直接继承行高——行高由两侧 130sp 大时间撑起,
|
||||
所以线高天然与时间文字一致,纯 XML 结构保证,不依赖任何运行时代码
|
||||
(此前两版运行时改高度的方案在锁屏/悬浮窗链路上都失效了)。
|
||||
下行是副行:任务名 | 占位 | 日期星期,与上行两栏逐列对齐。
|
||||
左右对称分栏——左侧倒计时(大)+ 任务名,右侧时钟(大)+ 日期星期,
|
||||
两侧主字号统一 130sp,视觉左右对应;无「工作中/休息中」提示。
|
||||
|
||||
分割线:保持最初可见版本的原始实现——静态 View 直接放在两栏之间,
|
||||
固定 dp 高度,无任何运行时改动(此前的 View.post / fontMetrics /
|
||||
match_parent 结构化三版方案在锁屏/悬浮窗链路上全部失效)。
|
||||
高度 150dp ≈ 130sp 时间文字的墨迹高度(1.17 × 130sp),仅分割两块大时间。
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/lockRoot"
|
||||
@@ -14,15 +16,10 @@
|
||||
android:background="@android:color/black"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 上行:倒计时 | 分割线 | 时钟(分割线高度=本行高度=时间文字高度) -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 左:倒计时 + 任务名 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -38,14 +35,27 @@
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="130sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLockTask"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:ellipsize="end"
|
||||
android:maxWidth="320dp"
|
||||
android:maxLines="1"
|
||||
android:textColor="#99FFFFFF"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 中:细分隔线(仅分割两块大时间,150dp≈130sp 文字墨迹高度) -->
|
||||
<View
|
||||
android:id="@+id/lockDivider"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="150dp"
|
||||
android:background="#26FFFFFF" />
|
||||
|
||||
<!-- 右:时钟(大)+ 日期星期在时钟下面 -->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -61,52 +71,14 @@
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="130sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 下行:任务名 | 占位(与分割线同宽,保持两栏对齐) | 日期星期 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLockTask"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxWidth="320dp"
|
||||
android:maxLines="1"
|
||||
android:textColor="#99FFFFFF"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLockDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:textColor="#99FFFFFF"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user