修复任务图标间距与项目编辑键盘遮挡(v3.6)
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
# 变更记录
|
||||
|
||||
## 2026-12-01 · 修复任务图标间距与项目编辑键盘遮挡(v3.6)
|
||||
|
||||
- 任务页图标间距:间距与图标改为各占一个字符。此前 `IconGapSpan` 与图标 `ReplacementSpan` 套在同一字符上,后设置的图标会覆盖间距,导致标题与置顶、置顶与重要度图标视觉贴住。现在两处均保留可见空隙,间距仍为原 3 空格的一半。
|
||||
- 项目编辑弹层:`ProjectSheet` 改用 `fitOnIme(root)` 的满屏容器 + 键盘顶起方案,拉起输入法时弹层整体上移,项目名称输入框与弹层边框不再被键盘遮住;同时保留点弹层外关闭。
|
||||
- 仅改 `TaskAdapter.kt` 与 `ProjectSheet.kt`,任务排序、图标样式、项目统计及其他页面逻辑不变。
|
||||
- versionCode 60 / versionName 3.6,签名不变(7bcbd511…cc8c83),可覆盖安装 v3.5。
|
||||
|
||||
## 2026-12-01 · 回退 v3.3 基线并删除内置收件箱(v3.5)
|
||||
|
||||
- 源码整体回退到 v3.3(commit 467d34a),撤销 v3.4 的项目页统计口径重构、完成记录折叠与执行入口移除;任务页、专注页选任务、项目展开均恢复 v3.3 行为。
|
||||
|
||||
@@ -35,7 +35,11 @@ class ProjectSheet(
|
||||
private var color: Int = existing?.color ?: Palette.colorAt(0)
|
||||
|
||||
init {
|
||||
setContentView(root)
|
||||
// 项目编辑含多个输入框:必须走满屏容器 + 键盘顶起,否则输入法会盖住弹层
|
||||
fitOnIme(root)
|
||||
// 满屏容器后仍保留“点弹层外关闭”,点弹层内部空白不关闭
|
||||
(root.parent as? View)?.setOnClickListener { dismiss() }
|
||||
root.setOnClickListener { }
|
||||
root.findViewById<TextView>(R.id.sheetTitle).setText(
|
||||
if (existing == null) R.string.add_project else R.string.edit
|
||||
)
|
||||
|
||||
@@ -539,6 +539,6 @@ class SettingsFragment : Fragment(R.layout.fragment_settings) {
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val VERSION = "3.5"
|
||||
const val VERSION = "3.6"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,6 +80,16 @@ class TaskAdapter(
|
||||
title.setSpan(IconGapSpan(), title.length - 1, title.length, 0)
|
||||
}
|
||||
|
||||
/**
|
||||
* 间距与图标必须各占一个字符。若把两个 ReplacementSpan 套在同一字符上,
|
||||
* 后设置的图标会覆盖间距,视觉上就贴住了。
|
||||
*/
|
||||
private fun appendIconSpan(title: SpannableStringBuilder, span: Any) {
|
||||
appendIconGap(title)
|
||||
title.append(" ")
|
||||
title.setSpan(span, title.length - 1, title.length, 0)
|
||||
}
|
||||
|
||||
private inner class TaskViewHolder(v: View) : RecyclerView.ViewHolder(v) {
|
||||
private val tvTitle: TextView = v.findViewById(R.id.tvTitle)
|
||||
private val tvMeta: TextView = v.findViewById(R.id.tvMeta)
|
||||
@@ -102,11 +112,7 @@ class TaskAdapter(
|
||||
|
||||
// 置顶图标前移到重要度圆圈之前(品牌蓝圆圈内向上箭头)
|
||||
if (task.repeatType == com.focusbox.app.model.Repeat.ANYTIME && !task.done) {
|
||||
appendIconGap(title)
|
||||
title.setSpan(
|
||||
PinIconSpan(ctx.col(R.color.brand), iconSize),
|
||||
title.length - 1, title.length, 0,
|
||||
)
|
||||
appendIconSpan(title, PinIconSpan(ctx.col(R.color.brand), iconSize))
|
||||
}
|
||||
|
||||
// 重要度圆圈:3 高 / 2 中 / 1 普通,颜色与紧急度同色系
|
||||
@@ -116,11 +122,7 @@ class TaskAdapter(
|
||||
else -> "1" to R.color.urgent_low
|
||||
}
|
||||
// 与标题、与置顶圆圈各留半个旧间距,避免图标贴在一起又不显得散
|
||||
appendIconGap(title)
|
||||
title.setSpan(
|
||||
PriorityBadgeSpan(ctx.col(badgeColor), iconSize, digit),
|
||||
title.length - 1, title.length, 0,
|
||||
)
|
||||
appendIconSpan(title, PriorityBadgeSpan(ctx.col(badgeColor), iconSize, digit))
|
||||
|
||||
// 紧急度五角星:紧急三颗红 / 中两颗绿 / 不急一颗灰
|
||||
val (stars, starColor) = when (task.urgency) {
|
||||
|
||||
Reference in New Issue
Block a user