feat(ui): 完成【版型切换】与【心率区间设置】页面 UI 重构及标准物料交付
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
---
|
||||
title: "APP界面优化 - 心率区间设置页面 (Heart Rate Zones)"
|
||||
status: "TODO"
|
||||
created: "2026-08-17"
|
||||
level: 1
|
||||
---
|
||||
|
||||
# 任务目标
|
||||
对系统设置子页面【心率区间设置】执行 UI 交互与视觉动感重构(**严格纯美化,禁止修改/增删字段,心率区间红/橙/绿/蓝/灰专属色彩 100% 锁死**)。
|
||||
核心解决三大问题:
|
||||
1. **纯色块生硬堆叠与草稿感**:将原粗暴纯色条升级为 **5 阶微渐变高质感卡片**,集成 **❤️ 拟真双跳动态心跳脉冲**;
|
||||
2. **右半屏空旷失衡**:引入 **黑曜石暗晶 HUD 动态监控台**(激光心电示波屏 + 天青色最大心率动态读数 + 5 阶流光能量阶梯);
|
||||
3. **参数调节缺乏联动**:拖动年龄滑块时,全屏心率区间与 HUD 看板毫秒级实时动态重算重绘。
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ 开发依据(标准物料约束)
|
||||
> 🚨 **绝对约束**:请 `@coder` 在修改代码前,**必须**完整阅读本工作台目录下的全部物料,严禁自行发挥排版!
|
||||
>
|
||||
> **工作台路径**:`设置页面UI优化/心率区间设置/`
|
||||
> 1. `baseline_ui.html`:**[必读]** 终极 HTML/CSS 排版基准源代码(双栏布局、❤️ 动态脉冲、HUD 示波、动态计算 JS)。
|
||||
> 2. `DESIGN_SPEC.md`:**[必读]** 视觉边界手册(1080dp 容器、350dp HUD、心率专属色彩阶梯、双跳心跳关键帧)。
|
||||
> 3. `implementation_plan.md`:**[必读]** CSS → Android Token 映射字典与原生落地清单。
|
||||
>
|
||||
> **原始出厂截屏**(信息字段保底凭证,只读):
|
||||
> - `Screenshot_20260817-135129.png`
|
||||
|
||||
---
|
||||
|
||||
## 📂 涉及文件清单
|
||||
|
||||
**1. Layout**
|
||||
- `app/src/main/res/layout/activity_heart_rate_zone_settings.xml`
|
||||
|
||||
**2. Java / Activity / Custom Views**
|
||||
- `app/src/main/java/com/umilab/eapmanage/team/settings/HeartRateZoneSettingsActivity.java`
|
||||
- `app/src/main/java/com/umilab/eapmanage/ui/view/EcgWaveformView.java`
|
||||
|
||||
**3. 动画与资源 (Animators & Drawables)**
|
||||
- `app/src/main/res/anim/anim_heart_pulse.xml`
|
||||
- `app/src/main/res/values/colors.xml`(补充 `hr_zone_1 ~ 5` 与 `hud_*` 色值)
|
||||
|
||||
---
|
||||
|
||||
## 📋 执行步骤清单
|
||||
1. **重构布局结构**:将 `activity_heart_rate_zone_settings.xml` 改为 AppBar + 顶部控制条 + 下方横向双栏(左侧 5 大心率卡片,右侧 350dp 黑曜石 HUD 监控面板)。
|
||||
2. **心率卡片视觉升级**:严格使用红、橙、绿、蓝、灰专属渐变 Drawable,12dp 圆角,左侧半透明黑底强度徽章。
|
||||
3. **心跳脉冲与示波动效**:❤️ 心形图标接入 `anim_heart_pulse.xml` 双跳动画;右侧接入 `EcgWaveformView` 激光心电动态波。
|
||||
4. **年龄联动计算**:在 `HeartRateZoneSettingsActivity.java` 中监听 `SeekBar`,按 Tanaka 矩阵动态计算并刷新 5 个区间心率范围与最大心率。
|
||||
5. **字段核验**:确保原图所有模式文本、百分比范围与说明文案 100% 完整保留。
|
||||
|
||||
---
|
||||
|
||||
## ✅ 验收标准
|
||||
- [ ] 平板横屏下展示为横向双栏架构,左侧 5 张渐变卡片 + 右侧黑曜石 HUD 监控台,饱满专业。
|
||||
- [ ] 心率 5 大区间专属色彩严格保持红、橙、绿、蓝、灰,无任何改动。
|
||||
- [ ] 原图所有文本字段(模式、年龄、主名称、辅助描述、心率范围、百分比)100% 对应原图无遗漏。
|
||||
- [ ] ❤️ 心形图标展现顺畅拟真双跳动态脉冲,拖动年龄滑块实时联动全页重算。
|
||||
- [ ] 所有颜色与尺寸严格使用 Android 语义 Token。
|
||||
@@ -0,0 +1,72 @@
|
||||
# 心率区间设置页面 — 视觉边界手册 DESIGN_SPEC
|
||||
|
||||
- **模块**:系统设置子页面 — 心率区间设置 (`HeartRateZoneSettingsActivity`)
|
||||
- **日期**:2026-08-17
|
||||
- **视觉基准**:同目录 `baseline_ui.html`(Compact Studio Pro 动感暗晶双栏架构)
|
||||
- **原始出厂截图**(只读引用):`./Screenshot_20260817-135129.png`
|
||||
|
||||
> **红线铁律复述**:
|
||||
> 1. **心率区间专属色彩系统 100% 锁死**:区间 5(红 `#FF3B30`)、区间 4(橙 `#FF9500`)、区间 3(绿 `#34C759`)、区间 2(蓝 `#007AFF`)、区间 1(灰 `#8E8E93`)严禁改动;
|
||||
> 2. **所有字段文案 100% 完整保留**,严禁篡改任何业务字段。
|
||||
|
||||
---
|
||||
|
||||
## 1. 宽屏平板布局架构 (Compact Studio Pro 双栏栅格)
|
||||
|
||||
### 1.1 现状痛点剖析
|
||||
1. **纯色色块生硬堆叠**:原截图中左侧 5 个区间为大面积粗暴纯色矩形,下划线输入极具草稿感;
|
||||
2. **右半屏严重留白失衡**:在横屏平板下,右半侧空无一物,空间浪费率超过 50%;
|
||||
3. **缺少运动健康动感氛围**:静态数据展示,缺少运动生理与心率脉冲的生命活力。
|
||||
|
||||
### 1.2 目标架构规范
|
||||
|
||||
| 规范项 | 参数值 | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| **容器最大宽度** | **1080dp** (`--content-max-width`) | 超出宽度时屏幕左右自动居中留白 (`margin: 0 auto`) |
|
||||
| **顶部控制面板** | **流线横向通栏** | 整合训练模式下拉选框与年龄调节滑动条 |
|
||||
| **左侧心率区间卡片区** | **自适应 1fr** (~650dp) | 纵向排布 Z5 ~ Z1 五张高质感渐变卡片,每张内含动态 ❤️ 心跳 |
|
||||
| **右侧暗晶 HUD 监控台** | **固定 350dp** | 黑曜石暗晶质感(`#0B0F19`),包含激光 ECG 示波屏、实时最大心率读数与流光能量阶梯 |
|
||||
| **AppBar 顶部栏** | **通栏 60dp** (`--appbar-height`) | 标题 19sp/700,返回箭头 48dp 触控槽 |
|
||||
| **卡片圆角** | **12dp** (区间卡片) / **16dp** (HUD面板) | 细微阴影与高斯流光 |
|
||||
|
||||
---
|
||||
|
||||
## 2. 字段与槽位核验清单 (100% 对齐原图)
|
||||
|
||||
| # | 区域 | 字段 / 元素标识 | 初始值 / 状态 | 规范与动感行为 |
|
||||
| :-: | :--- | :--- | :--- | :--- |
|
||||
| 1 | **AppBar** | 返回箭头 `(←)` | 交互按钮 | 38dp 触控槽,点击返回上一级 |
|
||||
| 2 | **AppBar** | `心率区间设置` | 页面标题 | 19sp / 700 字重 / `--text-main` |
|
||||
| 3 | **顶部控制** | `训练模式:` | 下拉标签 | 13.5sp / 600 字重 |
|
||||
| 4 | **顶部控制** | `普通模式` | 下拉选项 | Outlined Dropdown,内置普通/竞技/燃脂模式 |
|
||||
| 5 | **顶部控制** | `请输入用户年龄:` | 标签文案 | 13.5sp / 600 字重 |
|
||||
| 6 | **顶部控制** | `30` 岁 | 年龄数值 | 18sp 粗体 / 品牌主色,随滑动条实时联动 |
|
||||
| 7 | **顶部控制** | 年龄滑动条 (Slider) | 默认值 30 | 范围 10~90,拖动时实时联动重新计算全页面心率区间 |
|
||||
| 8 | **区间 5** | `区间5` / `高强度` | 强度标签 | 半透明黑底徽章(`rgba(0,0,0,0.22)`) |
|
||||
| 9 | **区间 5** | `极限冲刺` | 区间主名称 | 16.5sp / 700 / `#FFFFFF` |
|
||||
| 10 | **区间 5** | `提升冲刺速度` | 辅助描述 | 12sp / 0.92 不透明度 |
|
||||
| 11 | **区间 5** | `❤️ 166 - 185` | 心率范围 | **❤️ 带拟真双跳动态心电脉冲**,数值随年龄动态计算 |
|
||||
| 12 | **区间 5** | `最大心率的 90 - 100%` | 百分比说明 | 11.5sp / 0.9 不透明度 |
|
||||
| 13 | **区间 4** | `区间4` / `高强度` / `心肺提升` / `锻炼心肺功能` / `❤️ 148 - 166` / `最大心率的 80 - 90%` | 全量保留 | 橙色系渐变 `#FF9500` $\to$ `#FB8C00` |
|
||||
| 14 | **区间 3** | `区间3` / `中强度` / `加速燃烧` / `提高有氧效率` / `❤️ 129 - 148` / `最大心率的 70 - 80%` | 全量保留 | 绿色系渐变 `#34C759` $\to$ `#2E7D32` |
|
||||
| 15 | **区间 2** | `区间2` / `低强度` / `轻松减脂` / `改善耐力` / `❤️ 111 - 129` / `最大心率的 60 - 70%` | 全量保留 | 蓝色系渐变 `#007AFF` $\to$ `#1976D2` |
|
||||
| 16 | **区间 1** | `区间1` / `低强度` / `缓和热身` / `热身、恢复体力` / `❤️ 92 - 111` / `最大心率的 50 - 60%` | 全量保留 | 灰色系渐变 `#8E8E93` $\to$ `#757575` |
|
||||
| 17 | **右侧 HUD** | `动态心率监控` / `● LIVE ECG` | 监控标题 | 黑曜石暗晶 HUD,发光示波屏 + 流光能量阶梯 |
|
||||
|
||||
---
|
||||
|
||||
## 3. 动态交互与动画规范
|
||||
|
||||
### 3.1 ❤️ 双跳动感心电脉冲 (Double-Beat Lub-Dub)
|
||||
- 动画周期:`1.35s` 循环;
|
||||
- 关键帧节奏:`0% (scale 1) -> 14% (scale 1.32) -> 28% (scale 1.05) -> 42% (scale 1.22) -> 70% (scale 1)`;
|
||||
- 滤镜:`drop-shadow(0 0 4px rgba(255, 255, 255, 0.6))`。
|
||||
|
||||
### 3.2 动态心率换算算法 (Tanaka 矩阵)
|
||||
- 当用户拖动年龄滑动条 $Age$ 时:
|
||||
- 估算最大心率:$MaxHR = 220 - Age$
|
||||
- 区间 5:$[Round(MaxHR \times 0.90), MaxHR]$
|
||||
- 区间 4:$[Round(MaxHR \times 0.80), Round(MaxHR \times 0.90)]$
|
||||
- 区间 3:$[Round(MaxHR \times 0.70), Round(MaxHR \times 0.80)]$
|
||||
- 区间 2:$[Round(MaxHR \times 0.60), Round(MaxHR \times 0.70)]$
|
||||
- 区间 1:$[Round(MaxHR \times 0.50), Round(MaxHR \times 0.60)]$
|
||||
@@ -0,0 +1,675 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>EAPManageUI - 心率区间设置 (UI 重构基准)</title>
|
||||
<style>
|
||||
/* =========================================================================
|
||||
:root 全量 Design Tokens 声明 (心率区间专属色彩严格锁死)
|
||||
========================================================================= */
|
||||
:root {
|
||||
/* ── 心率 5 大区间专属色彩系统 (严格对齐原厂标准色阶) ── */
|
||||
--color-z5: #FF3B30;
|
||||
--color-z5-dark: #E53935;
|
||||
--color-z5-glow: rgba(255, 59, 48, 0.35);
|
||||
|
||||
--color-z4: #FF9500;
|
||||
--color-z4-dark: #FB8C00;
|
||||
--color-z4-glow: rgba(255, 149, 0, 0.35);
|
||||
|
||||
--color-z3: #34C759;
|
||||
--color-z3-dark: #2E7D32;
|
||||
--color-z3-glow: rgba(52, 199, 89, 0.35);
|
||||
|
||||
--color-z2: #007AFF;
|
||||
--color-z2-dark: #1976D2;
|
||||
--color-z2-glow: rgba(0, 122, 255, 0.35);
|
||||
|
||||
--color-z1: #8E8E93;
|
||||
--color-z1-dark: #757575;
|
||||
--color-z1-glow: rgba(142, 142, 147, 0.35);
|
||||
|
||||
/* ── 核心品牌与基础表面 ── */
|
||||
--color-primary: #3949AB;
|
||||
--color-primary-container: #EEF2FF;
|
||||
--color-surface: #FFFFFF;
|
||||
--color-surface-variant: #F8FAFC;
|
||||
--color-background: #F1F5F9;
|
||||
|
||||
/* ── 文本语义色 ── */
|
||||
--text-main: #0F172A;
|
||||
--text-sub: #64748B;
|
||||
--divider: #E2E8F0;
|
||||
--outline: #CBD5E1;
|
||||
|
||||
/* ── 监控面板深邃暗晶 HUD ── */
|
||||
--hud-bg: #0B0F19;
|
||||
--hud-card: rgba(19, 27, 46, 0.85);
|
||||
--hud-border: rgba(51, 65, 85, 0.6);
|
||||
--hud-text-primary: #F8FAFC;
|
||||
--hud-text-dim: #94A3B8;
|
||||
--hud-accent-cyan: #38BDF8;
|
||||
--hud-accent-green: #10B981;
|
||||
|
||||
/* ── 栅格与尺寸 ── */
|
||||
--content-max-width: 1080px;
|
||||
--appbar-height: 60px;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
|
||||
html {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
||||
"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
|
||||
background: var(--color-background);
|
||||
color: var(--text-main);
|
||||
min-height: 100vh;
|
||||
padding: 24px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.device-wrapper {
|
||||
width: 100%;
|
||||
max-width: var(--content-max-width);
|
||||
margin: 0 auto;
|
||||
background: var(--color-surface);
|
||||
border-radius: 20px;
|
||||
border: 1px solid var(--divider);
|
||||
box-shadow: 0 16px 40px rgba(15, 23, 42, 0.07);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* AppBar 顶部导航栏 */
|
||||
.appbar {
|
||||
height: var(--appbar-height);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 24px;
|
||||
border-bottom: 1px solid var(--divider);
|
||||
background: var(--color-surface);
|
||||
}
|
||||
|
||||
.appbar-nav {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
border-radius: 10px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
background: var(--color-surface-variant);
|
||||
border: 1px solid var(--divider);
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
|
||||
.appbar-nav:hover {
|
||||
background: #E2E8F0;
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.appbar-nav svg {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
fill: var(--text-main);
|
||||
}
|
||||
|
||||
.appbar-title {
|
||||
font-size: 19px;
|
||||
font-weight: 700;
|
||||
margin-left: 14px;
|
||||
letter-spacing: -0.2px;
|
||||
}
|
||||
|
||||
/* 顶部流线控制面板 */
|
||||
.control-bar {
|
||||
padding: 16px 28px;
|
||||
background: var(--color-surface-variant);
|
||||
border-bottom: 1px solid var(--divider);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.ctrl-mode {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.ctrl-label {
|
||||
font-size: 13.5px;
|
||||
font-weight: 600;
|
||||
color: var(--text-sub);
|
||||
}
|
||||
|
||||
.mode-select {
|
||||
appearance: none;
|
||||
background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%2364748B' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 12px center;
|
||||
border: 1.5px solid var(--divider);
|
||||
border-radius: 8px;
|
||||
padding: 8px 36px 8px 14px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--text-main);
|
||||
cursor: pointer;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.03);
|
||||
}
|
||||
|
||||
.ctrl-age {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
flex: 1;
|
||||
max-width: 440px;
|
||||
}
|
||||
|
||||
.age-display {
|
||||
font-size: 13.5px;
|
||||
font-weight: 600;
|
||||
color: var(--text-sub);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.age-display b {
|
||||
font-size: 18px;
|
||||
font-weight: 800;
|
||||
color: var(--color-primary);
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.age-slider {
|
||||
flex: 1;
|
||||
height: 6px;
|
||||
border-radius: 3px;
|
||||
background: #E2E8F0;
|
||||
outline: none;
|
||||
-webkit-appearance: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.age-slider::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
background: var(--color-primary);
|
||||
border: 2px solid #FFF;
|
||||
box-shadow: 0 2px 8px rgba(57, 73, 171, 0.4);
|
||||
cursor: pointer;
|
||||
transition: transform 0.15s ease;
|
||||
}
|
||||
|
||||
.age-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
|
||||
|
||||
/* 主体分栏区 */
|
||||
.page-body {
|
||||
padding: 24px 28px;
|
||||
display: flex;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
/* 左侧 5 大心率区间卡片堆叠 */
|
||||
.zones-stack {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 11px;
|
||||
}
|
||||
|
||||
.zone-card {
|
||||
border-radius: 12px;
|
||||
padding: 13px 18px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 14px;
|
||||
color: #FFFFFF;
|
||||
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,0.04);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.zone-card:hover {
|
||||
transform: translateX(4px);
|
||||
box-shadow: 0 6px 18px rgba(0,0,0,0.12);
|
||||
}
|
||||
|
||||
.z5 { background: linear-gradient(90deg, var(--color-z5) 0%, var(--color-z5-dark) 100%); }
|
||||
.z4 { background: linear-gradient(90deg, var(--color-z4) 0%, var(--color-z4-dark) 100%); }
|
||||
.z3 { background: linear-gradient(90deg, var(--color-z3) 0%, var(--color-z3-dark) 100%); }
|
||||
.z2 { background: linear-gradient(90deg, var(--color-z2) 0%, var(--color-z2-dark) 100%); }
|
||||
.z1 { background: linear-gradient(90deg, var(--color-z1) 0%, var(--color-z1-dark) 100%); }
|
||||
|
||||
.zone-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.badge-box {
|
||||
background: rgba(0, 0, 0, 0.22);
|
||||
border-radius: 8px;
|
||||
padding: 5px 9px;
|
||||
min-width: 56px;
|
||||
text-align: center;
|
||||
font-size: 12.5px;
|
||||
font-weight: 800;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.badge-intensity {
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
opacity: 0.92;
|
||||
}
|
||||
|
||||
.zone-title {
|
||||
font-size: 16.5px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.01em;
|
||||
}
|
||||
|
||||
.zone-sub {
|
||||
font-size: 12px;
|
||||
opacity: 0.92;
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
.zone-right { text-align: right; }
|
||||
|
||||
.hr-val-row {
|
||||
font-size: 18px;
|
||||
font-weight: 800;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 6px;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
/* ❤️ 逼真双跳动感心电脉冲动画 (Double-Beat Lub-Dub Heartbeat) */
|
||||
.dynamic-heart {
|
||||
display: inline-block;
|
||||
transform-origin: center center;
|
||||
animation: dynamicHeartbeat 1.35s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
|
||||
filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.6));
|
||||
}
|
||||
|
||||
@keyframes dynamicHeartbeat {
|
||||
0% { transform: scale(1); }
|
||||
14% { transform: scale(1.32); }
|
||||
28% { transform: scale(1.05); }
|
||||
42% { transform: scale(1.22); }
|
||||
70% { transform: scale(1); }
|
||||
100% { transform: scale(1); }
|
||||
}
|
||||
|
||||
.pct-val {
|
||||
font-size: 11.5px;
|
||||
opacity: 0.9;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
/* =========================================================================
|
||||
右侧高阶暗晶 HUD 监控面板 (Dark Obsidian Glass HUD)
|
||||
========================================================================= */
|
||||
.hud-monitor-panel {
|
||||
width: 350px;
|
||||
background: var(--hud-bg);
|
||||
background-image: radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.06) 0%, transparent 70%);
|
||||
border: 1px solid var(--hud-border);
|
||||
border-radius: 16px;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 30px rgba(0,0,0,0.4);
|
||||
}
|
||||
|
||||
.hud-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.hud-title {
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
color: var(--hud-text-primary);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.live-badge {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
background: rgba(16, 185, 129, 0.15);
|
||||
border: 1px solid rgba(16, 185, 129, 0.35);
|
||||
padding: 2px 8px;
|
||||
border-radius: 100px;
|
||||
font-size: 10.5px;
|
||||
font-weight: 700;
|
||||
color: var(--hud-accent-green);
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.live-dot {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background: var(--hud-accent-green);
|
||||
box-shadow: 0 0 6px var(--hud-accent-green);
|
||||
animation: blinkLive 1.5s infinite;
|
||||
}
|
||||
|
||||
@keyframes blinkLive {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.3; }
|
||||
}
|
||||
|
||||
/* ECG 动态示波窗 */
|
||||
.ecg-screen {
|
||||
height: 100px;
|
||||
background: rgba(10, 15, 29, 0.85);
|
||||
border: 1px solid rgba(56, 189, 248, 0.2);
|
||||
border-radius: 10px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 16px;
|
||||
box-shadow: inset 0 2px 10px rgba(0,0,0,0.6);
|
||||
}
|
||||
|
||||
/* 医疗网格背景 */
|
||||
.ecg-screen::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0; left: 0; right: 0; bottom: 0;
|
||||
background-image:
|
||||
linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
|
||||
linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
|
||||
background-size: 16px 16px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.ecg-laser-line {
|
||||
stroke: var(--hud-accent-green);
|
||||
stroke-width: 2.2;
|
||||
fill: none;
|
||||
stroke-dasharray: 600;
|
||||
stroke-dashoffset: 600;
|
||||
animation: laserSweep 2.2s linear infinite;
|
||||
filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.8));
|
||||
}
|
||||
|
||||
@keyframes laserSweep {
|
||||
to { stroke-dashoffset: 0; }
|
||||
}
|
||||
|
||||
/* 心率数值读数卡片 */
|
||||
.hud-readout-row {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
background: var(--hud-card);
|
||||
border: 1px solid var(--hud-border);
|
||||
border-radius: 10px;
|
||||
padding: 10px 14px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.readout-lbl {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--hud-text-dim);
|
||||
}
|
||||
|
||||
.readout-val {
|
||||
font-size: 20px;
|
||||
font-weight: 800;
|
||||
color: var(--hud-accent-cyan);
|
||||
letter-spacing: 0.03em;
|
||||
font-variant-numeric: tabular-nums;
|
||||
text-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
|
||||
}
|
||||
|
||||
/* =========================================================================
|
||||
流光阶梯能量条 (Shimmering Stream Zone Ladder)
|
||||
========================================================================= */
|
||||
.particle-zone-ladder {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
.ladder-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
font-size: 11.5px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.ladder-tag {
|
||||
width: 22px;
|
||||
color: var(--hud-text-dim);
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.ladder-stream-track {
|
||||
flex: 1;
|
||||
height: 9px;
|
||||
background: rgba(30, 41, 59, 0.7);
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
border: 1px solid rgba(255, 255, 255, 0.05);
|
||||
}
|
||||
|
||||
/* 流光能量条 */
|
||||
.ladder-stream-fill {
|
||||
height: 100%;
|
||||
border-radius: 5px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 动态扫描高光 */
|
||||
.ladder-stream-fill::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0; left: -100%; width: 100%; height: 100%;
|
||||
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
|
||||
animation: particleStreamShimmer 2.2s infinite ease-in-out;
|
||||
}
|
||||
|
||||
@keyframes particleStreamShimmer {
|
||||
0% { left: -100%; }
|
||||
100% { left: 200%; }
|
||||
}
|
||||
|
||||
.fill-z5 { width: 100%; background: linear-gradient(90deg, var(--color-z5), #FF6B6B); box-shadow: 0 0 8px var(--color-z5-glow); }
|
||||
.fill-z4 { width: 90%; background: linear-gradient(90deg, var(--color-z4), #FFB84D); box-shadow: 0 0 8px var(--color-z4-glow); }
|
||||
.fill-z3 { width: 80%; background: linear-gradient(90deg, var(--color-z3), #6BE68B); box-shadow: 0 0 8px var(--color-z3-glow); }
|
||||
.fill-z2 { width: 70%; background: linear-gradient(90deg, var(--color-z2), #5AC8FA); box-shadow: 0 0 8px var(--color-z2-glow); }
|
||||
.fill-z1 { width: 60%; background: linear-gradient(90deg, var(--color-z1), #AEAEB2); box-shadow: 0 0 8px var(--color-z1-glow); }
|
||||
|
||||
.ladder-pct {
|
||||
width: 32px;
|
||||
text-align: right;
|
||||
color: var(--hud-text-dim);
|
||||
font-size: 11px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="device-wrapper">
|
||||
<!-- AppBar 顶部导航栏 -->
|
||||
<header class="appbar">
|
||||
<div class="appbar-nav" title="返回"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></div>
|
||||
<h1 class="appbar-title">心率区间设置</h1>
|
||||
</header>
|
||||
|
||||
<!-- 顶部控制条 -->
|
||||
<div class="control-bar">
|
||||
<div class="ctrl-mode">
|
||||
<span class="ctrl-label">训练模式:</span>
|
||||
<select class="mode-select">
|
||||
<option>普通模式</option>
|
||||
<option>竞技模式</option>
|
||||
<option>燃脂模式</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="ctrl-age">
|
||||
<span class="age-display">请输入用户年龄:<b id="ageTxt">30</b> 岁</span>
|
||||
<input type="range" min="10" max="90" value="30" class="age-slider" id="ageInput" oninput="recalcHeartRates(this.value)">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 主体分栏内容区 -->
|
||||
<main class="page-body">
|
||||
<!-- 左侧 5 大心率区间卡片 -->
|
||||
<section class="zones-stack">
|
||||
<!-- 区间 5 (红) -->
|
||||
<div class="zone-card z5">
|
||||
<div class="zone-left">
|
||||
<div class="badge-box">区间5<br><span class="badge-intensity">高强度</span></div>
|
||||
<div>
|
||||
<div class="zone-title">极限冲刺</div>
|
||||
<div class="zone-sub">提升冲刺速度</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zone-right">
|
||||
<div class="hr-val-row"><span class="dynamic-heart">❤️</span> <span id="r5">166 - 185</span></div>
|
||||
<div class="pct-val">最大心率的 90 - 100%</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 区间 4 (橙) -->
|
||||
<div class="zone-card z4">
|
||||
<div class="zone-left">
|
||||
<div class="badge-box">区间4<br><span class="badge-intensity">高强度</span></div>
|
||||
<div>
|
||||
<div class="zone-title">心肺提升</div>
|
||||
<div class="zone-sub">锻炼心肺功能</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zone-right">
|
||||
<div class="hr-val-row"><span class="dynamic-heart">❤️</span> <span id="r4">148 - 166</span></div>
|
||||
<div class="pct-val">最大心率的 80 - 90%</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 区间 3 (绿) -->
|
||||
<div class="zone-card z3">
|
||||
<div class="zone-left">
|
||||
<div class="badge-box">区间3<br><span class="badge-intensity">中强度</span></div>
|
||||
<div>
|
||||
<div class="zone-title">加速燃烧</div>
|
||||
<div class="zone-sub">提高有氧效率</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zone-right">
|
||||
<div class="hr-val-row"><span class="dynamic-heart">❤️</span> <span id="r3">129 - 148</span></div>
|
||||
<div class="pct-val">最大心率的 70 - 80%</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 区间 2 (蓝) -->
|
||||
<div class="zone-card z2">
|
||||
<div class="zone-left">
|
||||
<div class="badge-box">区间2<br><span class="badge-intensity">低强度</span></div>
|
||||
<div>
|
||||
<div class="zone-title">轻松减脂</div>
|
||||
<div class="zone-sub">改善耐力</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zone-right">
|
||||
<div class="hr-val-row"><span class="dynamic-heart">❤️</span> <span id="r2">111 - 129</span></div>
|
||||
<div class="pct-val">最大心率的 60 - 70%</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 区间 1 (灰) -->
|
||||
<div class="zone-card z1">
|
||||
<div class="zone-left">
|
||||
<div class="badge-box">区间1<br><span class="badge-intensity">低强度</span></div>
|
||||
<div>
|
||||
<div class="zone-title">缓和热身</div>
|
||||
<div class="zone-sub">热身、恢复体力</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zone-right">
|
||||
<div class="hr-val-row"><span class="dynamic-heart">❤️</span> <span id="r1">92 - 111</span></div>
|
||||
<div class="pct-val">最大心率的 50 - 60%</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 右侧升级版黑曜石暗晶 HUD 监控台 -->
|
||||
<aside class="hud-monitor-panel">
|
||||
<div class="hud-header">
|
||||
<div class="hud-title">动态心率监控</div>
|
||||
<div class="live-badge">
|
||||
<span class="live-dot"></span>
|
||||
<span>LIVE ECG</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 激光心电示波屏 -->
|
||||
<div class="ecg-screen">
|
||||
<svg viewBox="0 0 300 100" style="width:100%; height:70px;">
|
||||
<path class="ecg-laser-line" d="M0,50 L40,50 L50,42 L60,58 L70,50 L100,50 L110,18 L120,82 L130,42 L140,55 L150,50 L190,50 L200,38 L210,62 L220,50 L300,50"/>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<!-- 动态最大心率读数 -->
|
||||
<div class="hud-readout-row">
|
||||
<span class="readout-lbl">预估最大负荷心率</span>
|
||||
<span class="readout-val" id="maxHrVal">190 BPM</span>
|
||||
</div>
|
||||
|
||||
<!-- 动态流光能量阶梯 -->
|
||||
<div class="particle-zone-ladder">
|
||||
<div class="ladder-item"><span class="ladder-tag">Z5</span><div class="ladder-stream-track"><div class="ladder-stream-fill fill-z5"></div></div><span class="ladder-pct">100%</span></div>
|
||||
<div class="ladder-item"><span class="ladder-tag">Z4</span><div class="ladder-stream-track"><div class="ladder-stream-fill fill-z4"></div></div><span class="ladder-pct">90%</span></div>
|
||||
<div class="ladder-item"><span class="ladder-tag">Z3</span><div class="ladder-stream-track"><div class="ladder-stream-fill fill-z3"></div></div><span class="ladder-pct">80%</span></div>
|
||||
<div class="ladder-item"><span class="ladder-tag">Z2</span><div class="ladder-stream-track"><div class="ladder-stream-fill fill-z2"></div></div><span class="ladder-pct">70%</span></div>
|
||||
<div class="ladder-item"><span class="ladder-tag">Z1</span><div class="ladder-stream-track"><div class="ladder-stream-fill fill-z1"></div></div><span class="ladder-pct">60%</span></div>
|
||||
</div>
|
||||
</aside>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 动态心率算法计算 (Tanaka 矩阵)
|
||||
function recalcHeartRates(age) {
|
||||
document.getElementById('ageTxt').innerText = age;
|
||||
const maxHr = 220 - age;
|
||||
document.getElementById('maxHrVal').innerText = maxHr + ' BPM';
|
||||
document.getElementById('r5').innerText = Math.round(maxHr * 0.9) + ' - ' + maxHr;
|
||||
document.getElementById('r4').innerText = Math.round(maxHr * 0.8) + ' - ' + Math.round(maxHr * 0.9);
|
||||
document.getElementById('r3').innerText = Math.round(maxHr * 0.7) + ' - ' + Math.round(maxHr * 0.8);
|
||||
document.getElementById('r2').innerText = Math.round(maxHr * 0.6) + ' - ' + Math.round(maxHr * 0.7);
|
||||
document.getElementById('r1').innerText = Math.round(maxHr * 0.5) + ' - ' + Math.round(maxHr * 0.6);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,69 @@
|
||||
# 心率区间设置页面 — 原生落地图纸 implementation_plan
|
||||
|
||||
- **模块**:系统设置 — 心率区间设置 (`HeartRateZoneSettingsActivity`)
|
||||
- **依据**:同目录 `baseline_ui.html` + `DESIGN_SPEC.md`
|
||||
- **原始出厂截图**:`./Screenshot_20260817-135129.png`
|
||||
- **执行角色**:`@coder` (Android 工程师)
|
||||
|
||||
---
|
||||
|
||||
## 1. CSS → Android Token 映射字典
|
||||
|
||||
### 1.1 颜色语义映射
|
||||
|
||||
| HTML CSS 变量 | 取值 | Android 语义 Token / 资源 ID | 状态 / 说明 |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| `--color-z5` | `#FF3B30` | `@color/hr_zone_5` (`#FF3B30`) | ✅ 心率区间 5 专属红色 |
|
||||
| `--color-z4` | `#FF9500` | `@color/hr_zone_4` (`#FF9500`) | ✅ 心率区间 4 专属橙色 |
|
||||
| `--color-z3` | `#34C759` | `@color/hr_zone_3` (`#34C759`) | ✅ 心率区间 3 专属绿色 |
|
||||
| `--color-z2` | `#007AFF` | `@color/hr_zone_2` (`#007AFF`) | ✅ 心率区间 2 专属蓝色 |
|
||||
| `--color-z1` | `#8E8E93` | `@color/hr_zone_1` (`#8E8E93`) | ✅ 心率区间 1 专属灰色 |
|
||||
| `--color-primary` | `#3949AB` | `?attr/colorPrimary` | ✅ 已存在,年龄数值高亮 |
|
||||
| `--color-surface` | `#FFFFFF` | `?attr/colorSurface` | ✅ 已存在,外层容器背景 |
|
||||
| `--color-background` | `#F1F5F9` | `?attr/colorBackground` | ✅ 已存在,页面底色 |
|
||||
| `--hud-bg` | `#0B0F19` | `@color/hud_monitor_bg` (`#0B0F19`) | ✅ 新建,右侧监控台底色 |
|
||||
| `--hud-accent-cyan` | `#38BDF8` | `@color/hud_accent_cyan` (`#38BDF8`) | ✅ 新建,LED 最大心率读数 |
|
||||
| `--hud-accent-green` | `#10B981` | `@color/hud_accent_green` (`#10B981`) | ✅ 新建,激光示波线颜色 |
|
||||
|
||||
---
|
||||
|
||||
## 2. Android 落地代码清单与改动指南
|
||||
|
||||
### 2.1 涉及文件
|
||||
|
||||
1. **布局文件 (Layout)**
|
||||
- `app/src/main/res/layout/activity_heart_rate_zone_settings.xml`
|
||||
2. **逻辑类 (Activity)**
|
||||
- `app/src/main/java/com/umilab/eapmanage/team/settings/HeartRateZoneSettingsActivity.java`
|
||||
3. **自定义 View / 动画 (Views & Animators)**
|
||||
- `app/src/main/java/com/umilab/eapmanage/ui/view/EcgWaveformView.java` (激光心电动态示波 View)
|
||||
- `app/src/main/res/anim/anim_heart_pulse.xml` (拟真双跳动态心跳动画)
|
||||
- `app/src/main/res/drawable/bg_zone_card_gradient.xml` (5 个区间专属渐变 Drawable)
|
||||
|
||||
---
|
||||
|
||||
### 2.2 具体实施步骤
|
||||
|
||||
#### 步骤 1:重构 `activity_heart_rate_zone_settings.xml`
|
||||
- 顶部保留 AppBar(`Toolbar`,60dp 高)。
|
||||
- 顶部控制条:放置训练模式 `Spinner` 与年龄 `SeekBar`。
|
||||
- 下方主体采用横向双栏:
|
||||
- 左侧 `LinearLayout`(权重 1 或自适应):垂直排布 5 张 `MaterialCardView`(Z5 ~ Z1),每张卡片放置强度 Tag、主名称、副描述、动态心形 `ImageView`、心率范围与百分比说明。
|
||||
- 右侧 `CardView`(固定 350dp,底色 `#0B0F19`):放置 `EcgWaveformView`、最大心率动态读数、及 5 阶流光能量进度条。
|
||||
|
||||
#### 步骤 2:心跳脉冲与 ECG 示波动效
|
||||
- 为 5 张卡片中的 `iv_heart_icon` 绑定 `anim_heart_pulse.xml`,开启 `Animation.INFINITE`。
|
||||
- `EcgWaveformView` 使用 `Path` + `ValueAnimator` 绘制绿色激光扫描心电波。
|
||||
|
||||
#### 步骤 3:`HeartRateZoneSettingsActivity.java` 年龄动态联动
|
||||
- 监听 `sb_age.setOnSeekBarChangeListener`:
|
||||
- 拖动时动态计算 $MaxHR = 220 - age$;
|
||||
- 动态刷新 `tv_max_hr_hud` 与 5 个区间的 `tv_hr_range_z1 ~ z5` 文字。
|
||||
|
||||
---
|
||||
|
||||
## 3. 验收核验标准
|
||||
- [ ] 平板横屏下展示为居中双栏架构,左侧 5 张渐变卡片 + 右侧黑曜石 HUD 监控台。
|
||||
- [ ] 5 个心率区间专属色彩严格保持为红、橙、绿、蓝、灰,无任何色系偏差。
|
||||
- [ ] 所有字段、文案、模式选项与百分比完全对应原图 `Screenshot_20260817-135129.png`。
|
||||
- [ ] ❤️ 心形图标具备平滑拟真双跳心电脉冲,拖动年龄滑块实时联动全页数据。
|
||||
@@ -0,0 +1,58 @@
|
||||
---
|
||||
title: "APP界面优化 - 选择版型页面 (Edition Selection)"
|
||||
status: "TODO"
|
||||
created: "2026-08-17"
|
||||
level: 1
|
||||
---
|
||||
|
||||
# 任务目标
|
||||
对系统设置子页面【选择版型 / 版型切换】执行 UI 交互与视觉重构(**严格纯美化,禁止修改/增删字段**)。
|
||||
核心解决两大问题:
|
||||
1. **彻底修复描边逻辑颠倒 Bug**:原版中专业版硬编码为蓝框、自定义版硬编码为绿框,现统一纠正为:选中态 = Primary 蓝描边 + 浅蓝底,未选中态 = 中性细描边;
|
||||
2. **消弭宽屏单列失衡**:升级为 **Split Studio 宽屏沉浸双栏架构**(左侧 320dp 决策说明与当前生效版型联动面板 + 右侧卡片选择区),与【语言设置】形成全 App 统一的控制台体验。
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ 开发依据(标准物料约束)
|
||||
> 🚨 **绝对约束**:请 `@coder` 在修改代码前,**必须**完整阅读本工作台目录下的全部物料,严禁自行发挥排版!
|
||||
>
|
||||
> **工作台路径**:`设置页面UI优化/版型切换/`
|
||||
> 1. `baseline_ui.html`:**[必读]** 终极 HTML/CSS 排版基准源代码(双栏布局、卡片选中态、状态联动、Token 声明)。
|
||||
> 2. `DESIGN_SPEC.md`:**[必读]** 视觉边界手册(双栏尺寸、卡片圆角、描边状态机、响应式断点)。
|
||||
> 3. `implementation_plan.md`:**[必读]** CSS → Android Token 映射字典与原生落地清单。
|
||||
>
|
||||
> **原始出厂截屏**(信息字段保底凭证,只读):
|
||||
> - `Screenshot_20260812_143347.png`
|
||||
|
||||
---
|
||||
|
||||
## 📂 涉及文件清单
|
||||
|
||||
**1. Layout**
|
||||
- `app/src/main/res/layout/activity_edition_selection.xml`
|
||||
|
||||
**2. Java / Activity**
|
||||
- `app/src/main/java/com/umilab/eapmanage/team/edition/EditionSelectionActivity.java`
|
||||
|
||||
**3. 资源与样式 (Resources & Drawables)**
|
||||
- `app/src/main/res/drawable/selector_edition_card_bg.xml`(新建)
|
||||
- `app/src/main/res/values/dimens.xml`(补充 `settings_sidebar_width_wide`)
|
||||
|
||||
---
|
||||
|
||||
## 📋 执行步骤清单
|
||||
1. **重构布局结构**:将 `activity_edition_selection.xml` 改为 AppBar + 居中 940dp 水平双栏容器(左侧 320dp 概览面板,右侧卡片选择区)。
|
||||
2. **两张版型卡片重构**:设置 16dp 圆角,左侧放置 RadioButton 与 4dp Active 竖向光条,右侧为版型名称与描述。
|
||||
3. **修复描边与背景状态机**:移除原硬编码蓝/绿描边,绑定 `selector_edition_card_bg.xml`,选中态展示 `colorPrimaryContainer` 浅蓝底 + `colorPrimary` 蓝描边。
|
||||
4. **左侧当前版型联动**:在 `EditionSelectionActivity.java` 中将点击事件与左侧 `tv_current_selected_edition` 文本实现实时刷新。
|
||||
5. **确认按钮**:底部设置浅绿确认按钮(`Widget.EAPManage.Button.Tonal` / `colorSecondaryContainer`),高度 48dp。
|
||||
6. **字段核验**:确保原图所有文案与红框柱状图图标 100% 完整保留。
|
||||
|
||||
---
|
||||
|
||||
## ✅ 验收标准
|
||||
- [ ] 平板横屏下展示为居中双栏控制台布局,大屏视觉平衡饱满。
|
||||
- [ ] 彻底纠正描边逻辑错误(选中为 Primary 蓝描边+浅蓝底,未选中为中性细描边,两张卡逻辑严格一致)。
|
||||
- [ ] 原版红框柱状图图标与所有文本字段 100% 对应原图,无任何遗漏。
|
||||
- [ ] 点击卡片时,选中背景、指示条、Radio 动画及左侧状态面板同步联动。
|
||||
- [ ] 所有颜色与尺寸严格使用 Android 语义 Token,无任何 XML 硬编码。
|
||||
@@ -0,0 +1,64 @@
|
||||
# 选择版型页面 — 视觉边界手册 DESIGN_SPEC
|
||||
|
||||
- **模块**:系统设置子页面 — 选择版型 / 版型切换 (`EditionSelectionActivity`)
|
||||
- **日期**:2026-08-17
|
||||
- **视觉基准**:同目录 `baseline_ui.html`(Split Studio 双栏专业控制台架构)
|
||||
- **原始出厂截图**(只读引用):`./Screenshot_20260812_143347.png`
|
||||
|
||||
> **铁律复述**:本次重构为纯 UI 视觉升级与描边逻辑修复。全量字段名、描述文本、Icon 图标及按钮交互全部 100% 保留,严禁篡改任何业务字段。
|
||||
|
||||
---
|
||||
|
||||
## 1. 宽屏平板布局架构 (Split Master-Detail 栅格规范)
|
||||
|
||||
### 1.1 现状缺陷剖析
|
||||
1. **描边逻辑颠倒 Bug**:原截图 `Screenshot_20260812_143347.png` 中,“专业版(未选中)”硬编码为蓝框,“自定义功能版(已选中)”硬编码为绿框,描边与卡片身份绑死,严重误导用户。
|
||||
2. **超宽拉伸失衡**:在 16:10 / 16:9 横屏平板下,单列卡片横跨整个屏幕,文字空旷,视觉焦点极度涣散。
|
||||
|
||||
### 1.2 目标架构规范 (Split Studio 双栏控制台)
|
||||
|
||||
| 规范项 | 参数值 | 说明 |
|
||||
| :--- | :--- | :--- |
|
||||
| **内容容器最大宽度** | **940dp** (`--content-max-width`) | 超出宽度时屏幕左右自动居中留白 (`margin: 0 auto`) |
|
||||
| **左侧概览面板 (Master)** | **固定 320dp** (`--sidebar-width`) | 包含原版红框 3 柱状图图标、大标题“选择版型”、说明副文本、当前选定版型状态卡片 |
|
||||
| **右侧卡片选择区 (Detail)** | **自适应 1fr** (~596dp) | 纵向排布两张版型卡片 + 底部确认按钮 |
|
||||
| **AppBar 顶部栏** | **通栏 60dp** (`--appbar-height`) | 标题 20sp/600,返回箭头 48dp 触控槽 |
|
||||
| **卡片圆角与间距** | **16dp 圆角** / **16dp 间距** | 1.5px 精细边框 + 微投影 Level 1 |
|
||||
| **响应式断点** | **768dp** | `< 768dp`(分屏/竖屏)时自动回落为单列流式堆叠 |
|
||||
|
||||
---
|
||||
|
||||
## 2. 字段与槽位核验清单 (100% 对齐原图)
|
||||
|
||||
| # | 区域 | 字段 / 元素标识 | 初始状态 / 规范 |
|
||||
| :-: | :--- | :--- | :--- |
|
||||
| 1 | **AppBar** | 返回箭头 `(←)` | 48dp 触控槽,点击返回上一级 |
|
||||
| 2 | **AppBar** | `选择版型` | 20sp / 600 字重 / `--text-primary` |
|
||||
| 3 | **Hero 引导** | 红框柱状图图标 | 52dp 尺寸,原版红框 `#FF5252`,内含 3 根垂直条 |
|
||||
| 4 | **Hero 引导** | `选择版型` | 21sp / 700 字重 / `--text-primary` |
|
||||
| 5 | **Hero 引导** | `请选择适合您使用场景的版型,后续可在设置中更改` | 13.5sp / `--text-secondary` / 1.6 行高 |
|
||||
| 6 | **卡片 1** | 单选 Radio 钮 | 未选中态(空心圆圈) |
|
||||
| 7 | **卡片 1** | `专业版` | 17.5sp / 700 字重 |
|
||||
| 8 | **卡片 1** | `为专业场馆管理员设计,布局固定专业化,核心数据字段默认全开,开箱即用` | 13.8sp / `--text-secondary` |
|
||||
| 9 | **卡片 2** | 单选 Radio 钮 | **默认选中态**(实心圆点) |
|
||||
| 10 | **卡片 2** | `自定义功能版` | 17.5sp / 700 字重 |
|
||||
| 11 | **卡片 2** | `高度可配置,所有高级功能开放,适合研究员和高级用户` | 13.8sp / `--text-secondary` |
|
||||
| 12 | **动作区** | `确定` 按钮 | 浅绿底 `--color-secondary-container` + 绿字 `--color-secondary`,48dp 高,12dp 圆角 |
|
||||
|
||||
---
|
||||
|
||||
## 3. 状态机与交互规范
|
||||
|
||||
### 3.1 卡片状态机 (彻底纠正原图颠倒逻辑)
|
||||
|
||||
| 状态 | 描边 (Border) | 背景色 | 左侧 Active 指示条 | RadioButton | 投影 |
|
||||
| :--- | :--- | :--- | :--- | :--- | :--- |
|
||||
| **未选中 (Unselected)** | `1.5dp --divider` (`#E2E8F0`) | `#FFFFFF` | `opacity: 0` | 2dp `#CBD5E1` 空心圈 | Level 1 |
|
||||
| **悬停 (Hover)** | `1.5dp #94A3B8` | `#F8FAFC` | `opacity: 0` | 不变 | Level 2 |
|
||||
| **选中态 (Selected)** | `1.5dp --color-primary` (`#3949AB`) | `--color-primary-container` (`#EEF2FF`) | `opacity: 1; scaleY: 1` (`#3949AB`) | 2dp `#3949AB` 圈 + 10dp 实心蓝点 | Level 2 + 蓝光 |
|
||||
| **点击 (Pressed)** | 保持 | 略微加深 4% | 保持 | 触发缩放涟漪 | Level 1 |
|
||||
|
||||
### 3.2 左右状态联动
|
||||
- 当用户点击右侧任一版型卡片时:
|
||||
1. 当前卡片获得选中态,另一张卡片恢复未选中态;
|
||||
2. 左侧侧边栏底部的「当前选定版型」文案即时联动刷新(如“自定义功能版” $\leftrightarrow$ “专业版”)。
|
||||
@@ -0,0 +1,456 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>EAPManageUI - 选择版型 (UI 重构基准)</title>
|
||||
<style>
|
||||
/* =========================================================================
|
||||
:root 全量 Design Tokens 声明 (与系统设置全局规范严格对齐)
|
||||
========================================================================= */
|
||||
:root {
|
||||
/* ── 核心主题色 ── */
|
||||
--color-primary: #3949AB;
|
||||
--color-primary-dark: #283593;
|
||||
--color-primary-container: #EEF2FF;
|
||||
--color-on-primary-container: #1A237E;
|
||||
--color-primary-hover: rgba(57, 73, 171, 0.04);
|
||||
--color-primary-glow: rgba(57, 73, 171, 0.12);
|
||||
|
||||
/* ── 辅助确认色 ── */
|
||||
--color-secondary: #00897B;
|
||||
--color-secondary-container: #E0F2F1;
|
||||
--color-on-secondary: #FFFFFF;
|
||||
--color-secondary-hover: #C8ECE7;
|
||||
|
||||
/* ── 表面与背景 ── */
|
||||
--color-surface: #FFFFFF;
|
||||
--color-surface-variant: #F8FAFC;
|
||||
--color-background: #F1F5F9;
|
||||
|
||||
/* ── 文本语义色 ── */
|
||||
--text-primary: #0F172A;
|
||||
--text-secondary: #64748B;
|
||||
--text-disabled: #CBD5E1;
|
||||
|
||||
/* ── 边框与分割线 ── */
|
||||
--divider: #E2E8F0;
|
||||
--outline: #CBD5E1;
|
||||
|
||||
/* ── 圆角阶梯 ── */
|
||||
--corner-sm: 8px;
|
||||
--corner-md: 12px;
|
||||
--corner-lg: 16px;
|
||||
--corner-pill: 999px;
|
||||
|
||||
/* ── 阴影阶梯 ── */
|
||||
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.03);
|
||||
--shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
|
||||
--shadow-lg: 0 16px 36px -8px rgba(15, 23, 42, 0.08);
|
||||
|
||||
/* ── 尺寸与栅格 ── */
|
||||
--content-max-width: 940px;
|
||||
--sidebar-width: 320px;
|
||||
--appbar-height: 60px;
|
||||
--touch-min: 48px;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
|
||||
html {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
||||
"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
|
||||
background: var(--color-background);
|
||||
color: var(--text-primary);
|
||||
min-height: 100vh;
|
||||
padding: 24px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* 视口模拟器容器 */
|
||||
.screen-container {
|
||||
width: 100%;
|
||||
max-width: 1060px;
|
||||
margin: 0 auto;
|
||||
background: var(--color-surface);
|
||||
border-radius: 20px;
|
||||
border: 1px solid var(--divider);
|
||||
box-shadow: var(--shadow-lg);
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* AppBar 顶部导航栏 */
|
||||
.appbar {
|
||||
height: var(--appbar-height);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 24px;
|
||||
background: var(--color-surface);
|
||||
border-bottom: 1px solid var(--divider);
|
||||
}
|
||||
|
||||
.appbar-nav {
|
||||
width: var(--touch-min);
|
||||
height: var(--touch-min);
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: var(--corner-md);
|
||||
cursor: pointer;
|
||||
background: var(--color-surface-variant);
|
||||
border: 1px solid var(--divider);
|
||||
transition: all 0.15s ease;
|
||||
margin-left: -4px;
|
||||
}
|
||||
|
||||
.appbar-nav:hover {
|
||||
background: #E2E8F0;
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.appbar-nav svg {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
fill: var(--text-primary);
|
||||
}
|
||||
|
||||
.appbar-title {
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
margin-left: 14px;
|
||||
letter-spacing: -0.2px;
|
||||
}
|
||||
|
||||
/* 双栏主体布局 */
|
||||
.page-body {
|
||||
padding: 32px 28px 40px;
|
||||
background: var(--color-background);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.master-detail-layout {
|
||||
width: 100%;
|
||||
max-width: var(--content-max-width);
|
||||
display: flex;
|
||||
gap: 24px;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
/* 左侧概览面板 (Master Summary) */
|
||||
.summary-sidebar {
|
||||
flex: 0 0 var(--sidebar-width);
|
||||
background: var(--color-surface);
|
||||
border-radius: var(--corner-lg);
|
||||
border: 1px solid var(--divider);
|
||||
box-shadow: var(--shadow-sm);
|
||||
padding: 28px 24px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* 出厂原版粉红/红框柱状图图标 (高精细度还原) */
|
||||
.sidebar-icon-box {
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
border: 2.5px solid #FF5252;
|
||||
border-radius: 12px;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: center;
|
||||
padding: 8px 6px;
|
||||
gap: 4px;
|
||||
background: #FFFFFF;
|
||||
margin-bottom: 20px;
|
||||
box-shadow: 0 4px 12px rgba(255, 82, 82, 0.12);
|
||||
}
|
||||
|
||||
.sidebar-icon-box .bar {
|
||||
width: 6px;
|
||||
background: #FF5252;
|
||||
border-radius: 2px 2px 0 0;
|
||||
}
|
||||
|
||||
.sidebar-icon-box .b1 { height: 14px; }
|
||||
.sidebar-icon-box .b2 { height: 26px; }
|
||||
.sidebar-icon-box .b3 { height: 18px; }
|
||||
|
||||
.sidebar-title {
|
||||
font-size: 21px;
|
||||
font-weight: 700;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 8px;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.sidebar-desc {
|
||||
font-size: 13.5px;
|
||||
line-height: 1.6;
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
/* 当前选定状态联动卡片 */
|
||||
.status-pill-box {
|
||||
margin-top: auto;
|
||||
background: var(--color-surface-variant);
|
||||
border: 1px solid var(--divider);
|
||||
border-radius: var(--corner-md);
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.status-label {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--text-secondary);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.status-value {
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
color: var(--color-primary);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: #10B981;
|
||||
box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
|
||||
}
|
||||
|
||||
/* 右侧选择区与操作 */
|
||||
.main-selection {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.edition-card {
|
||||
background: var(--color-surface);
|
||||
border: 1.5px solid var(--divider);
|
||||
border-radius: var(--corner-lg);
|
||||
padding: 22px 24px;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 18px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
box-shadow: var(--shadow-sm);
|
||||
position: relative;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.edition-card:hover {
|
||||
border-color: #94A3B8;
|
||||
background: #F8FAFC;
|
||||
transform: translateY(-1px);
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
.edition-card.is-selected {
|
||||
border-color: var(--color-primary);
|
||||
background: var(--color-primary-container);
|
||||
box-shadow: 0 4px 20px rgba(57, 73, 171, 0.12);
|
||||
}
|
||||
|
||||
/* 选中左侧指示光条 */
|
||||
.card-active-indicator {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 18px;
|
||||
bottom: 18px;
|
||||
width: 4px;
|
||||
border-radius: 0 4px 4px 0;
|
||||
background: var(--color-primary);
|
||||
opacity: 0;
|
||||
transform: scaleY(0.4);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.edition-card.is-selected .card-active-indicator {
|
||||
opacity: 1;
|
||||
transform: scaleY(1);
|
||||
}
|
||||
|
||||
.radio-slot {
|
||||
margin-top: 2px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.radio-outer {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
border-radius: 50%;
|
||||
border: 2px solid var(--outline);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #FFFFFF;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.edition-card.is-selected .radio-outer {
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
.radio-inner {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
background: var(--color-primary);
|
||||
opacity: 0;
|
||||
transform: scale(0.3);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.edition-card.is-selected .radio-inner {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
.edition-info { flex: 1; }
|
||||
|
||||
.edition-name {
|
||||
font-size: 17.5px;
|
||||
font-weight: 700;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 6px;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.edition-card.is-selected .edition-name {
|
||||
color: var(--color-on-primary-container);
|
||||
}
|
||||
|
||||
.edition-desc {
|
||||
font-size: 13.8px;
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.btn-confirm-wrap {
|
||||
margin-top: auto;
|
||||
padding-top: 8px;
|
||||
}
|
||||
|
||||
.btn-confirm {
|
||||
width: 100%;
|
||||
height: 48px;
|
||||
background: var(--color-secondary-container);
|
||||
color: var(--color-secondary);
|
||||
border: 1px solid rgba(0, 137, 123, 0.2);
|
||||
border-radius: var(--corner-md);
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.15s ease;
|
||||
letter-spacing: 0.05em;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.btn-confirm:hover {
|
||||
background: var(--color-secondary-hover);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 12px rgba(0, 137, 123, 0.15);
|
||||
}
|
||||
|
||||
.btn-confirm:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.master-detail-layout {
|
||||
flex-direction: column;
|
||||
}
|
||||
.summary-sidebar {
|
||||
flex: none;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="screen-container">
|
||||
<header class="appbar">
|
||||
<div class="appbar-nav" title="返回"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></div>
|
||||
<h1 class="appbar-title">选择版型</h1>
|
||||
</header>
|
||||
|
||||
<main class="page-body">
|
||||
<div class="master-detail-layout">
|
||||
<!-- 左侧状态概览面板 -->
|
||||
<aside class="summary-sidebar">
|
||||
<div class="sidebar-icon-box">
|
||||
<div class="bar b1"></div>
|
||||
<div class="bar b2"></div>
|
||||
<div class="bar b3"></div>
|
||||
</div>
|
||||
<h2 class="sidebar-title">选择版型</h2>
|
||||
<p class="sidebar-desc">请选择适合您使用场景的版型,后续可在设置中更改</p>
|
||||
|
||||
<div class="status-pill-box">
|
||||
<div class="status-label">当前选定版型</div>
|
||||
<div class="status-value">
|
||||
<span class="status-dot"></span>
|
||||
<span id="currEditionLabel">自定义功能版</span>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- 右侧版型卡片选择区 -->
|
||||
<section class="main-selection" id="editionGroup">
|
||||
<div class="edition-card" onclick="selectEdition(this, '专业版')">
|
||||
<div class="card-active-indicator"></div>
|
||||
<div class="radio-slot"><div class="radio-outer"><div class="radio-inner"></div></div></div>
|
||||
<div class="edition-info">
|
||||
<h3 class="edition-name">专业版</h3>
|
||||
<p class="edition-desc">为专业场馆管理员设计,布局固定专业化,核心数据字段默认全开,开箱即用</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="edition-card is-selected" onclick="selectEdition(this, '自定义功能版')">
|
||||
<div class="card-active-indicator"></div>
|
||||
<div class="radio-slot"><div class="radio-outer"><div class="radio-inner"></div></div></div>
|
||||
<div class="edition-info">
|
||||
<h3 class="edition-name">自定义功能版</h3>
|
||||
<p class="edition-desc">高度可配置,所有高级功能开放,适合研究员和高级用户</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btn-confirm-wrap">
|
||||
<button class="btn-confirm">确定</button>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function selectEdition(el, name) {
|
||||
document.querySelectorAll('.edition-card').forEach(c => c.classList.remove('is-selected'));
|
||||
el.classList.add('is-selected');
|
||||
document.getElementById('currEditionLabel').innerText = name;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,81 @@
|
||||
# 选择版型页面 — 原生落地图纸 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。
|
||||
Reference in New Issue
Block a user