v3.24 设置页导出配色/类型设置行去标题/统计页顶部文案

This commit is contained in:
XIGE
2026-12-03 09:46:17 +08:00
parent 6518b0970a
commit 22dd9334a3
3 changed files with 50 additions and 8 deletions

View File

@@ -148,9 +148,10 @@ class SettingsFragment : Fragment(R.layout.fragment_settings) {
section(R.string.section_types)
card(
// 类型只是给项目打的标签:值列表可改,改完项目弹层与统计页的类型分布立刻跟着变
// 类型只是给项目打的标签:值列表可改,改完项目弹层与统计页的类型分布立刻跟着变。
// 行标题「类型设置」按用户要求去掉,空间让给类型列表;点击弹窗等行为不变
action(
getString(R.string.type_settings),
"",
Prefs.projectTypes.joinToString("、"),
) { inputProjectTypes() },
)
@@ -171,8 +172,13 @@ class SettingsFragment : Fragment(R.layout.fragment_settings) {
section(R.string.section_data)
card(
// 导出排在最前:删除即真删、系统备份也已关闭,误清空后只能靠这份文件
action(getString(R.string.export_data), getString(R.string.export_value)) {
// 导出排在最前:删除即真删、系统备份也已关闭,误清空后只能靠这份文件。
// 标题与下面两条危险操作同色(红色),看起来是一组的
action(
getString(R.string.export_data),
getString(R.string.export_value),
titleColorRes = R.color.danger,
) {
exportDoc.launch("focusbox-" + Dates.dayKey(System.currentTimeMillis()) + ".json")
},
// 清理旧版本删除任务后残留的孤儿记录,排在「清空所有数据」前面:
@@ -296,6 +302,7 @@ class SettingsFragment : Fragment(R.layout.fragment_settings) {
value: String,
danger: Boolean = false,
showArrow: Boolean = true,
titleColorRes: Int = 0,
onClick: (() -> Unit)? = null,
): View {
val ctx = requireContext()
@@ -311,7 +318,15 @@ class SettingsFragment : Fragment(R.layout.fragment_settings) {
row.addView(TextView(ctx).apply {
text = title
textSize = 15f
setTextColor(col(if (danger) R.color.danger else R.color.text))
setTextColor(
col(
when {
danger -> R.color.danger
titleColorRes != 0 -> titleColorRes
else -> R.color.text
}
)
)
isSingleLine = true
layoutParams = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
@@ -763,6 +778,6 @@ class SettingsFragment : Fragment(R.layout.fragment_settings) {
}
companion object {
const val VERSION = "3.23"
const val VERSION = "3.24"
}
}

View File

@@ -133,9 +133,9 @@
<string name="stats_title">统计</string>
<string name="today">今日</string>
<string name="focus_minutes">专注时长</string>
<string name="focus_minutes">今日累计时长</string>
<string name="pomodoro_count">番茄数</string>
<string name="completed_tasks">完成任务</string>
<string name="completed_tasks">任务数</string>
<string name="goal_short">%1$dM</string>
<string name="trend_title">趋势</string>
<string name="heatmap_title">频率</string>