fix: 任务页面优化老年人布局
- 去掉左右标签行(ConfigRow),改为全部居中展示 - 状态标签顶部居中带pill背景色 - 任务名 30sp 最大最醒目 - 地点 22sp 蓝色 - 时间信息合并显示(派单+截止+要求完成) - 积分 24sp 橙色(0分时隐藏) - 操作按钮 24sp 更大 - 返回按钮 40dp 更大触摸区 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,45 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 任务列表页(单任务展示,上下滑切换)
|
||||
顶部:返回 + "第X/Y个任务" + 分段控件
|
||||
中间:当前任务详情(lookTaskDetail)
|
||||
底部:固定操作按钮 -->
|
||||
老年人用户:重点信息大而突出,次要信息精简
|
||||
布局:标题栏 → 任务名(最大) → 地点 → 关键信息 → 操作按钮 -->
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/background">
|
||||
|
||||
<!-- 可滑动内容区(底部留出按钮空间) -->
|
||||
<!-- 内容区 -->
|
||||
<ScrollView
|
||||
android:id="@+id/scrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="none"
|
||||
android:paddingStart="21dp"
|
||||
android:paddingTop="27dp"
|
||||
android:paddingEnd="21dp"
|
||||
android:paddingBottom="72dp"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="21dp"
|
||||
android:paddingTop="27dp"
|
||||
android:paddingEnd="21dp">
|
||||
|
||||
<!-- 页面头部:返回 + 标题(第X/Y个任务) -->
|
||||
<!-- 标题栏:返回 + 第X/Y个 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginBottom="8dp">
|
||||
android:layout_marginBottom="12dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btnBack"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:gravity="center"
|
||||
android:text="‹"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="27sp" />
|
||||
android:textSize="32sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvTitle"
|
||||
@@ -47,98 +46,99 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginEnd="32dp" />
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="18sp"
|
||||
android:layout_marginEnd="40dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 任务详情区域(lookTaskDetail 数据) -->
|
||||
<!-- ===== 任务详情区域 ===== -->
|
||||
<LinearLayout
|
||||
android:id="@+id/taskContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<!-- 派单时间 -->
|
||||
<!-- 状态标签(最顶部,彩色醒目) -->
|
||||
<TextView
|
||||
android:id="@+id/tvSendTime"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/tvStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="22sp"
|
||||
android:layout_marginBottom="8dp" />
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="10dp" />
|
||||
|
||||
<!-- 任务名称(大字居中) -->
|
||||
<!-- 任务名称(最大最醒目) -->
|
||||
<TextView
|
||||
android:id="@+id/tvTaskName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="26sp"
|
||||
android:textSize="30sp"
|
||||
android:textStyle="bold"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
||||
<!-- 地点 -->
|
||||
<!-- 地点(蓝色醒目) -->
|
||||
<TextView
|
||||
android:id="@+id/tvPosition"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/primary"
|
||||
android:textSize="20sp"
|
||||
android:textSize="22sp"
|
||||
android:layout_marginBottom="16dp" />
|
||||
|
||||
<!-- 信息行列表 -->
|
||||
<LinearLayout style="@style/ConfigRow">
|
||||
<TextView style="@style/ConfigLabel" android:text="派单号" />
|
||||
<TextView android:id="@+id/tvNo" style="@style/ConfigValue"
|
||||
android:textColor="@color/text_secondary" />
|
||||
</LinearLayout>
|
||||
<!-- 派单时间 + 截止时间(一行显示) -->
|
||||
<TextView
|
||||
android:id="@+id/tvTimeInfo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="18sp"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
||||
<LinearLayout style="@style/ConfigRow">
|
||||
<TextView style="@style/ConfigLabel" android:text="积分" />
|
||||
<TextView android:id="@+id/tvPoints" style="@style/ConfigValue"
|
||||
android:textColor="@color/warning" />
|
||||
</LinearLayout>
|
||||
<!-- 积分(大字橙色) -->
|
||||
<TextView
|
||||
android:id="@+id/tvPoints"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/warning"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- 状态标签 -->
|
||||
<LinearLayout style="@style/ConfigRow">
|
||||
<TextView style="@style/ConfigLabel" android:text="状态" />
|
||||
<TextView android:id="@+id/tvStatus" style="@style/ConfigValue" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 截止时间 -->
|
||||
<LinearLayout android:id="@+id/rowExpire" style="@style/ConfigRow"
|
||||
android:visibility="gone">
|
||||
<TextView style="@style/ConfigLabel" android:text="截止" />
|
||||
<TextView android:id="@+id/tvExpireTime" style="@style/ConfigValue" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 预计完成时间(指派任务) -->
|
||||
<LinearLayout android:id="@+id/rowPreFinish" style="@style/ConfigRow"
|
||||
android:visibility="gone">
|
||||
<TextView style="@style/ConfigLabel" android:text="要求完成" />
|
||||
<TextView android:id="@+id/tvPreFinishTime" style="@style/ConfigValue" />
|
||||
</LinearLayout>
|
||||
<!-- 上报人(type 3/4) -->
|
||||
<TextView
|
||||
android:id="@+id/tvCreatorName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="18sp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- 协作人 -->
|
||||
<LinearLayout android:id="@+id/rowWorkers" style="@style/ConfigRow"
|
||||
android:visibility="gone">
|
||||
<TextView style="@style/ConfigLabel" android:text="协作人" />
|
||||
<TextView android:id="@+id/tvWorkers" style="@style/ConfigValue" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 上报人(用户上报/巡检上报任务) -->
|
||||
<LinearLayout android:id="@+id/rowCreator" style="@style/ConfigRow"
|
||||
android:visibility="gone">
|
||||
<TextView style="@style/ConfigLabel" android:text="上报人" />
|
||||
<TextView android:id="@+id/tvCreatorName" style="@style/ConfigValue" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/tvWorkers"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="18sp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- 任务描述 -->
|
||||
<TextView
|
||||
@@ -146,23 +146,22 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="17sp"
|
||||
android:textSize="18sp"
|
||||
android:lineSpacingMultiplier="1.5"
|
||||
android:layout_marginTop="8dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- 提示条(待打卡+有场景) -->
|
||||
<!-- 提示条(黄色醒目) -->
|
||||
<TextView
|
||||
android:id="@+id/tvHint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:padding="11dp"
|
||||
android:text="请将手表贴近打卡信标"
|
||||
android:padding="13dp"
|
||||
android:textColor="@color/warning"
|
||||
android:textSize="16sp"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -175,7 +174,7 @@
|
||||
android:gravity="center"
|
||||
android:text="暂无任务"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="20sp"
|
||||
android:textSize="24sp"
|
||||
android:paddingTop="80dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
@@ -190,8 +189,8 @@
|
||||
android:visibility="gone">
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:indeterminateTint="@color/text_secondary" />
|
||||
|
||||
<TextView
|
||||
@@ -199,7 +198,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="加载中"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="16sp"
|
||||
android:textSize="20sp"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -208,18 +207,18 @@
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<!-- 底部固定操作按钮 -->
|
||||
<!-- 底部固定操作按钮(大字) -->
|
||||
<TextView
|
||||
android:id="@+id/btnAction"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:gravity="center"
|
||||
android:padding="19dp"
|
||||
android:padding="21dp"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="21sp"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
android:letterSpacing="0.05"
|
||||
android:letterSpacing="0.08"
|
||||
android:visibility="gone" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
Reference in New Issue
Block a user