fix: 待打卡布局优化,地点提到最前防超屏
- 去掉蓝色指引块(和按钮文字重复) - 时间合入橙色地点块副文本 - 有场景时不单独显示 tvTimeInfo,省一行空间 - 备注和语音移到指引块后面(次要信息) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -281,22 +281,34 @@ class TaskListFragment : BaseFragment<FragmentTaskListBinding>() {
|
||||
showVoice(detail)
|
||||
}
|
||||
|
||||
// ===== 待打卡:指引去哪+怎么做 =====
|
||||
// ===== 待打卡:地点最优先,其他次要 =====
|
||||
3 -> {
|
||||
// 要求/截止时间(只显示一个)
|
||||
showDeadline(detail)
|
||||
// 备注
|
||||
showNote(detail)
|
||||
|
||||
if (detail.hasPosition) {
|
||||
// 有场景:两段式指引
|
||||
// 有场景:地点紧跟任务名,最突出
|
||||
val deadlineText = when {
|
||||
!detail.preFinishTime.isNullOrEmpty() -> "要求: ${detail.preFinishTime}"
|
||||
!detail.expireTime.isNullOrEmpty() -> "截止: ${detail.expireTime}"
|
||||
else -> null
|
||||
}
|
||||
// 地点+时间合到橙色块里,一眼看全
|
||||
binding.tvGoWhereTitle.text = "前往 ${detail.positionText}"
|
||||
binding.blockGoWhere.visibility = View.VISIBLE
|
||||
binding.blockHowTo.visibility = View.VISIBLE
|
||||
// 去掉蓝色块(和按钮文字重复),把时间放在橙色块提示文字里
|
||||
val hint = if (deadlineText != null) {
|
||||
"到达后贴近信标打卡 · $deadlineText"
|
||||
} else {
|
||||
"到达后贴近信标打卡"
|
||||
}
|
||||
// 更新橙色块的副文本
|
||||
(binding.blockGoWhere.getChildAt(1) as? android.widget.TextView)?.text = hint
|
||||
} else {
|
||||
// 无场景:绿色引导
|
||||
// 无场景:绿色引导 + 时间
|
||||
showDeadline(detail)
|
||||
binding.blockNoScene.visibility = View.VISIBLE
|
||||
}
|
||||
// 备注和语音放在指引块后面(次要信息)
|
||||
showNote(detail)
|
||||
showVoice(detail)
|
||||
}
|
||||
|
||||
// ===== 进行中/待完成:地点+打卡时间+完成指引 =====
|
||||
|
||||
Reference in New Issue
Block a user