fix: 任务页3项优化

1. 标题栏固定顶部不随内容滚动
2. 底部按钮高度缩小(padding 21→13dp)字体加大(24→28sp)
3. 待完成页面改为:地点+备注+打卡时间+绿色指引块"任务进行中,完成工作后点击下方按钮"
   按钮文字改为"完成任务"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dongliang
2026-04-28 13:29:33 +09:30
parent d7b61bf0fa
commit 7f06cdc9d1
2 changed files with 277 additions and 246 deletions

View File

@@ -227,7 +227,7 @@ class TaskListFragment : BaseFragment<FragmentTaskListBinding>() {
binding.blockGoWhere.visibility = View.GONE
binding.blockHowTo.visibility = View.GONE
binding.blockNoScene.visibility = View.GONE
binding.blockCheckedIn.visibility = View.GONE
binding.blockInProgress.visibility = View.GONE
// 按状态显示不同内容
when (detail.status) {
@@ -272,19 +272,25 @@ class TaskListFragment : BaseFragment<FragmentTaskListBinding>() {
}
}
// ===== 进行中/待完成:打卡确认+完成指引 =====
// ===== 进行中/待完成:地点+打卡时间+完成指引 =====
4 -> {
// 地点(提醒在哪里工作)
if (detail.hasPosition) {
binding.tvPosition.text = "📍 ${detail.positionText}"
binding.tvPosition.visibility = View.VISIBLE
}
// 备注
showNote(detail)
// 打卡确认时间
// 打卡时间(如果有)
if (!detail.confirmTime.isNullOrEmpty()) {
val time = detail.confirmTime.split(" ").lastOrNull() ?: detail.confirmTime
binding.tvCheckinTime.text = time
} else {
binding.tvCheckinTime.text = ""
binding.tvCheckinTime.text = "<EFBFBD><EFBFBD><EFBFBD> ${detail.confirmTime} 已打卡"
binding.tvCheckinTime.visibility = View.VISIBLE
}
binding.blockCheckedIn.visibility = View.VISIBLE
// 绿色指引块:任务进行中+完成指引
binding.blockInProgress.visibility = View.VISIBLE
}
// ===== 其他状态 =====
@@ -386,9 +392,9 @@ class TaskListFragment : BaseFragment<FragmentTaskListBinding>() {
}
}
/** 设置确认完成按钮状态4 */
/** 设置完成任务按钮状态4 */
private fun setupCompleteButton(btn: android.widget.TextView, detail: TaskDetail) {
btn.text = "确认完成"
btn.text = "完成任务"
btn.setBackgroundResource(R.drawable.bg_foot_btn_green)
btn.setOnClickListener { doAction("complete", detail.id) }
}

View File

@@ -1,33 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 任务页面(原型图V3适老化设计
120dpi屏幕老年人用户所有字体放大 -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<!-- 任务页面原型图V3适老化设计
1. 标题栏固定顶部不滚动
2. 底部按钮高度缩小字体加大
3. 待完成页面逻辑优化 -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background">
android:background="@color/background"
android:orientation="vertical">
<ScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
android:paddingBottom="72dp"
android:clipToPadding="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="21dp"
android:paddingTop="27dp"
android:paddingEnd="21dp">
<!-- 标题栏:返回 + 状态名 + 页码 -->
<!-- ===== 固定标题栏(不随内容滚动) ===== -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_marginBottom="13dp">
android:paddingStart="21dp"
android:paddingTop="27dp"
android:paddingEnd="21dp"
android:paddingBottom="8dp">
<TextView
android:id="@+id/btnBack"
@@ -59,6 +49,27 @@
</LinearLayout>
<!-- ===== 可滚动内容区(标题和按钮之间) ===== -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<ScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
android:clipToPadding="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="21dp"
android:paddingEnd="21dp"
android:paddingBottom="8dp">
<!-- ===== 任务内容区 ===== -->
<LinearLayout
android:id="@+id/taskContent"
@@ -67,7 +78,7 @@
android:orientation="vertical"
android:visibility="gone">
<!-- 任务名称(最大最突出,34sp -->
<!-- 任务名称34sp -->
<TextView
android:id="@+id/tvTaskName"
android:layout_width="match_parent"
@@ -99,7 +110,7 @@
android:layout_marginBottom="8dp"
android:visibility="gone" />
<!-- 积分(橙色大字26sp -->
<!-- 积分橙色26sp -->
<TextView
android:id="@+id/tvPoints"
android:layout_width="match_parent"
@@ -123,8 +134,6 @@
android:layout_marginBottom="11dp"
android:visibility="gone" />
<!-- ===== 指引块标题24sp说明20sp ===== -->
<!-- 指引块1去哪里橙色 -->
<LinearLayout
android:id="@+id/blockGoWhere"
@@ -209,34 +218,49 @@
android:layout_marginTop="5dp" />
</LinearLayout>
<!-- ===== 待完成:打卡确认 ===== -->
<!-- 待完成:任务进行中信息 -->
<LinearLayout
android:id="@+id/blockCheckedIn"
android:id="@+id/blockInProgress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingTop="8dp"
android:visibility="gone">
<!-- 打卡时间 -->
<TextView
android:id="@+id/tvCheckinTime"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/text_secondary"
android:textSize="22sp"
android:layout_marginBottom="13dp" />
<!-- 绿色指引块:完成指引 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_action_block_green"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="任务进行中"
android:textColor="@color/success"
android:textSize="44sp"
android:textSize="24sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="打卡成功\n完成任务后点下方按钮"
android:text="完成工作后,点击下方按钮确认"
android:textColor="@color/text_secondary"
android:textSize="20sp"
android:gravity="center"
android:lineSpacingMultiplier="1.5"
android:layout_marginTop="8dp" />
android:layout_marginTop="5dp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
@@ -279,19 +303,20 @@
</LinearLayout>
</ScrollView>
</FrameLayout>
<!-- 底部操作按钮(大字+宽间距) -->
<!-- ===== 底部操作按钮(高度缩小,字体加大) ===== -->
<TextView
android:id="@+id/btnAction"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:gravity="center"
android:padding="21dp"
android:paddingTop="13dp"
android:paddingBottom="13dp"
android:textColor="@color/text_primary"
android:textSize="24sp"
android:textSize="28sp"
android:textStyle="bold"
android:letterSpacing="0.12"
android:visibility="gone" />
</FrameLayout>
</LinearLayout>