任务完成后从列表消失;重要度改名并新增紧急度五角星;通知按钮间距与默认专注页

This commit is contained in:
XIGE
2026-11-28 17:11:28 +08:00
parent 6d13a5bf3c
commit 6b68d56467
13 changed files with 176 additions and 58 deletions

View File

@@ -67,6 +67,7 @@ class TaskAdapter(
private inner class TaskViewHolder(v: View) : RecyclerView.ViewHolder(v) {
private val tvTitle: TextView = v.findViewById(R.id.tvTitle)
private val tvStars: TextView = v.findViewById(R.id.tvStars)
private val tvMeta: TextView = v.findViewById(R.id.tvMeta)
private val tvNote: TextView = v.findViewById(R.id.tvNote)
private val checkCircle: View = v.findViewById(R.id.checkCircle)
@@ -87,6 +88,20 @@ class TaskAdapter(
tvTitle.setTextColor(ctx.col(if (task.done) R.color.text_tertiary else R.color.text))
tvTitle.typeface = if (task.priority >= 2 && !task.done) Typeface.DEFAULT_BOLD else Typeface.DEFAULT
// 紧急度五角星:紧急三颗红 / 中两颗绿 / 不急一颗灰;完成任务不再显示
if (!task.done) {
val (stars, color) = when (task.urgency) {
2 -> "★★★" to R.color.urgent_high
1 -> "★★" to R.color.urgent_mid
else -> "★" to R.color.urgent_low
}
tvStars.text = stars
tvStars.setTextColor(ctx.col(color))
tvStars.visible(true)
} else {
tvStars.visible(false)
}
if (task.done) {
checkCircle.background = ctx.circleBg(ctx.col(R.color.brand))
checkMark.visible(true)