修复负数计时回归:前台服务类型按版本显式选型;重要度改圆圈数字;置顶改上箭头(v0.10)
This commit is contained in:
@@ -85,21 +85,22 @@ class TaskAdapter(
|
||||
val ctx = itemView.context
|
||||
|
||||
// 标题右侧的属性图标,未完成与已完成都显示:
|
||||
// 重要度竖线(高3/中2/低1,颜色与紧急度同色系)→ 紧急度五角星 → 随时图钉。
|
||||
// 重要度圆圈数字(③ 高 / ② 中 / ① 普通,颜色与紧急度同色系)→
|
||||
// 紧急度五角星 → 随时上箭头。
|
||||
// 用 spannable 保证图标紧贴标题而不是被推到行尾。
|
||||
val title = SpannableStringBuilder(task.title)
|
||||
|
||||
val (bars, barColor) = when (task.priority) {
|
||||
2 -> " ▏▏▏" to R.color.urgent_high
|
||||
1 -> " ▏▏" to R.color.urgent_mid
|
||||
else -> " ▏" to R.color.urgent_low
|
||||
val (badge, badgeColor) = when (task.priority) {
|
||||
2 -> " ③" to R.color.urgent_high
|
||||
1 -> " ②" to R.color.urgent_mid
|
||||
else -> " ①" to R.color.urgent_low
|
||||
}
|
||||
title.append(bars)
|
||||
title.append(badge)
|
||||
title.setSpan(
|
||||
android.text.style.ForegroundColorSpan(ctx.col(barColor)),
|
||||
title.length - bars.length, title.length, 0
|
||||
android.text.style.ForegroundColorSpan(ctx.col(badgeColor)),
|
||||
title.length - badge.length, title.length, 0
|
||||
)
|
||||
title.setSpan(RelativeSizeSpan(0.95f), title.length - bars.length, title.length, 0)
|
||||
title.setSpan(RelativeSizeSpan(0.95f), title.length - badge.length, title.length, 0)
|
||||
|
||||
// 紧急度五角星:紧急三颗红 / 中两颗绿 / 不急一颗灰
|
||||
val (stars, starColor) = when (task.urgency) {
|
||||
@@ -114,9 +115,14 @@ class TaskAdapter(
|
||||
)
|
||||
title.setSpan(RelativeSizeSpan(0.95f), title.length - stars.length, title.length, 0)
|
||||
|
||||
// 「随时」任务:标题后带置顶图钉,列表里排在未完成最前面
|
||||
// 「随时」任务:标题后带品牌蓝上箭头表示置顶,列表里排在未完成最前面
|
||||
if (task.repeatType == com.focusbox.app.model.Repeat.ANYTIME && !task.done) {
|
||||
title.append(" 📌")
|
||||
title.append(" ↑")
|
||||
title.setSpan(
|
||||
android.text.style.ForegroundColorSpan(ctx.col(R.color.brand)),
|
||||
title.length - 2, title.length, 0
|
||||
)
|
||||
title.setSpan(RelativeSizeSpan(0.95f), title.length - 2, title.length, 0)
|
||||
}
|
||||
|
||||
tvTitle.text = title
|
||||
|
||||
Reference in New Issue
Block a user