Files
EAP_Interface_html/设置页面UI优化/版型切换/implementation_plan.md
T

82 lines
5.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 选择版型页面 — 原生落地图纸 implementation_plan
- **模块**:系统设置 — 版型切换 (`EditionSelectionActivity`)
- **依据**:同目录 `baseline_ui.html` + `DESIGN_SPEC.md`
- **原始出厂截图**:`./Screenshot_20260812_143347.png`
- **执行角色**:`@coder` (Android 工程师)
---
## 1. CSS → Android Token 映射字典
### 1.1 颜色语义映射
| HTML CSS 变量 | 取值 | Android 语义 Token / 资源 ID | 状态 / 说明 |
| :--- | :--- | :--- | :--- |
| `--color-primary` | `#3949AB` | `?attr/colorPrimary` (`@color/color_primary`) | ✅ 已存在,选中卡片描边与指示器 |
| `--color-on-primary` | `#FFFFFF` | `?attr/colorOnPrimary` | ✅ 已存在 |
| `--color-primary-container` | `#EEF2FF` | `?attr/colorPrimaryContainer` (`@color/color_primary_container`) | ✅ 已存在,选中卡片底色 |
| `--color-on-primary-container` | `#1A237E` | `?attr/colorOnPrimaryContainer` | ✅ 已存在,选中卡片标题色 |
| `--color-secondary` | `#00897B` | `?attr/colorSecondary` (`@color/color_secondary`) | ✅ 已存在,确认按钮文字 |
| `--color-secondary-container` | `#E0F2F1` | `?attr/colorSecondaryContainer` (`@color/color_secondary_container`) | ✅ 已存在,确认按钮浅绿底色 |
| `--color-surface` | `#FFFFFF` | `?attr/colorSurface` (`@color/color_surface`) | ✅ 已存在,卡片背景色 |
| `--color-surface-variant` | `#F8FAFC` | `?attr/colorSurfaceVariant` | ✅ 已存在,侧边栏底色 |
| `--color-background` | `#F1F5F9` | `?attr/colorBackground` (`@color/color_background`) | ✅ 已存在,页面底色 |
| `--text-primary` | `#0F172A` | `@color/text_primary` | ✅ 已存在,主标题与主要文字 |
| `--text-secondary` | `#64748B` | `@color/text_secondary` | ✅ 已存在,说明副文本 |
| `--divider` | `#E2E8F0` | `@color/divider` | ✅ 已存在,分割线与浅描边 |
| `--outline` | `#CBD5E1` | `@color/outline` | ✅ 已存在,单选外圈 |
### 1.2 尺寸与间距 Token 映射
| HTML CSS 变量 | 取值 | Android 推荐 Token | 规范落地建议 |
| :--- | :--- | :--- | :--- |
| `--content-max-width` | 940px | `@dimen/content_max_width_split` (940dp) | 宽屏双栏内容容器最大宽度 |
| `--sidebar-width` | 320px | `@dimen/settings_sidebar_width_wide` (320dp) | 左侧状态概览面板固定宽度 |
| `--appbar-height` | 60px | `@dimen/appbar_height` (60dp 或复用 56dp) | Toolbar 高度 |
| `--corner-md` | 12px | `@dimen/corner_radius_md` (12dp) | 按钮与内部小组件圆角 |
| `--corner-lg` | 16px | `@dimen/corner_radius_lg` (16dp) | 版型卡片与侧边面板圆角 |
| `--spacing-md` | 16px | `@dimen/spacing_md` (16dp) | 卡片间距 |
| `--spacing-lg` | 24px | `@dimen/spacing_xl` (24dp) | 双栏间距与安全边距 |
---
## 2. Android 落地代码清单与改动指南
### 2.1 涉及文件
1. **布局文件 (Layout)**
- `app/src/main/res/layout/activity_edition_selection.xml`
2. **逻辑类 (Activity)**
- `app/src/main/java/com/umilab/eapmanage/team/edition/EditionSelectionActivity.java`
3. **新增资源 (Drawable)**
- `app/src/main/res/drawable/selector_edition_card_bg.xml` (卡片背景与描边选择器)
- `app/src/main/res/drawable/ic_edition_histogram.xml` (原版红框柱状图矢量图标)
---
### 2.2 具体实施步骤
#### 步骤 1:重构 `activity_edition_selection.xml`
- 将原有的单列居中布局重构为 **AppBar + 居中 940dp 水平双栏容器 (`LinearLayout horizontal`)**。
- 左侧 `summary-sidebar`:放置原版红框柱状图图标、大标题“选择版型”、说明、及 `tv_current_selected_edition` 状态卡片。
- 右侧 `main-selection`:放置两张 `MaterialCardView`(专业版与自定义功能版)以及底部 `btn_confirm` 确认按钮。
#### 步骤 2:修复卡片描边与选中状态
- 移除原代码中与卡片身份死绑的硬编码边框颜色(彻底去除专业版硬编码蓝框、自定义版硬编码绿框)。
- 卡片采用 `MaterialCardView` 统一绑定 `selector_edition_card_bg.xml` 或在 Activity 中动态设置 `strokeColor`/`cardBackgroundColor`:
- 选中态:`strokeColor = ?attr/colorPrimary` (1.5dp), `cardBackgroundColor = ?attr/colorPrimaryContainer`
- 未选中态:`strokeColor = ?attr/colorOutlineVariant` (1dp), `cardBackgroundColor = ?attr/colorSurface`
#### 步骤 3:`EditionSelectionActivity.java` 交互与联动
- 点击卡片时,更新选中状态并刷新左侧 `tv_current_selected_edition` 文本。
- 点击底部 `btn_confirm` 执行版型生效逻辑。
---
## 3. 验收核验标准
- [ ] 平板横屏下展示为居中双栏控制台布局,视觉平衡饱满。
- [ ] 彻底修复原图中一蓝一绿的描边逻辑错误(选中为 Primary 蓝描边+浅蓝底,未选中为中性浅描边)。
- [ ] 原版红框柱状图图标、文案“选择版型”、“请选择适合您使用场景的版型,后续可在设置中更改”、“专业版”、“自定义功能版”、“确定”全量保留无遗漏。
- [ ] 所有颜色与尺寸严格使用 Android 语义 Token。