v3.21 项目卡三点菜单新增「新建任务」

This commit is contained in:
XIGE
2026-12-02 19:35:38 +08:00
parent 787b5db81e
commit 9584603d8b
3 changed files with 17 additions and 3 deletions

View File

@@ -155,6 +155,9 @@ class ProjectsFragment : Fragment(R.layout.fragment_projects) {
val isInbox = p.id == Store.INBOX_ID
val actions = ArrayList<Pair<String, Boolean>>()
actions.add(getString(R.string.edit) to false)
// 编辑下面直接给「新建任务」:建在当前项目下,弹层与任务页、专注页用的是同一个
// TaskSheet,保存后回本页刷新,省掉「切到任务页 → 点 + → 再选项目」两步
actions.add(getString(R.string.add_task) to false)
if (!isInbox) {
actions.add(getString(if (p.archived) R.string.unarchive else R.string.archive) to false)
actions.add(getString(R.string.delete) to true)
@@ -162,7 +165,8 @@ class ProjectsFragment : Fragment(R.layout.fragment_projects) {
actionSheet(p.name, actions = actions) { which ->
when {
which == 0 -> ProjectSheet(requireContext(), p) { reload() }.show()
which == 1 && !isInbox -> {
which == 1 -> TaskSheet(requireContext(), null, p.id) { reload() }.show()
which == 2 && !isInbox -> {
// 归档/取消归档只切 archived,序号、置顶状态与类型原样保留
Store.updateProject(
p.id, p.name, p.color, !p.archived,
@@ -170,7 +174,7 @@ class ProjectsFragment : Fragment(R.layout.fragment_projects) {
)
reload()
}
which == 2 && !isInbox -> confirmDelete(p)
which == 3 && !isInbox -> confirmDelete(p)
}
}
}

View File

@@ -737,6 +737,6 @@ class SettingsFragment : Fragment(R.layout.fragment_settings) {
}
companion object {
const val VERSION = "3.20"
const val VERSION = "3.21"
}
}