专注选任务、任务页与项目页口径重整(v3.7)
This commit is contained in:
@@ -543,8 +543,8 @@ class FocusFragment : Fragment(R.layout.fragment_focus) {
|
||||
btnBack.visibility = View.VISIBLE
|
||||
btnClear.visibility = View.VISIBLE
|
||||
list.removeAllViews()
|
||||
// 与项目展开同口径:逾期任务只在任务页出现,选任务列表只列当前可专注的
|
||||
val tasks = Store.tasks(projectId, includeDone = false, includeOverdue = false)
|
||||
// 选任务只按项目列任务:不按完成、逾期过滤,也不显示完成记录
|
||||
val tasks = Store.projectTasks(projectId)
|
||||
if (tasks.isEmpty()) {
|
||||
list.addView(TextView(ctx).apply {
|
||||
text = getString(R.string.pick_task_empty)
|
||||
@@ -555,9 +555,10 @@ class FocusFragment : Fragment(R.layout.fragment_focus) {
|
||||
})
|
||||
}
|
||||
tasks.forEach { t ->
|
||||
val meta = buildString {
|
||||
append(getString(R.string.minutes_value, t.focusMinutes))
|
||||
if (t.due > 0) append(" · ${Dates.dueLabel(t.due)}截止")
|
||||
val meta = if (t.due > 0) {
|
||||
"${Dates.dueLabel(t.due)}截止"
|
||||
} else {
|
||||
getString(R.string.time_anytime)
|
||||
}
|
||||
addRow(
|
||||
title = t.title,
|
||||
@@ -587,7 +588,7 @@ class FocusFragment : Fragment(R.layout.fragment_focus) {
|
||||
Store.projects().forEach { p ->
|
||||
addRow(
|
||||
title = p.name,
|
||||
meta = getString(R.string.pick_project_meta, p.openTasks),
|
||||
meta = getString(R.string.pick_project_meta, p.totalTasks),
|
||||
color = p.color,
|
||||
selected = p.id == currentPid,
|
||||
alignLeft = true, // 项目列表不要左侧色点缩进,名称贴左对齐
|
||||
|
||||
Reference in New Issue
Block a user