0
Fork 0
mirror of https://github.com/Silent1566/webhtv.git synced 2026-10-02 06:16:35 +00:00

fix(ui): 壁纸之上的页面列表文字统一为亮色

承接 59ea0fe6c(设置页 257 处),补完同类遗漏:列表项与叠加视图同样压在
深色壁纸/视频上,却仍用 ?attr/colorOnSurface —— 日间模式解析为 #1A1C1E,
深字压深底。

判定依据不是文件类型,而是「文字最近祖先背景 + 宿主是否对话框」:
  · 半透明黑或透明背景(shape_live #66000000、shape_item/shape_item_round
    /shape_search_hot_word → @color/selector_item 15%% 黑、shape_vod_list
    #33000000、shape_vod_name、shape_video_item → selector_video_item
    #80000000/#4D000000、shape_video_episode_grid #99000000)→ 需亮字
  · 不透明亮底(shape_light_dialog_item #FFFFFF、selector_custom_csp_item
    #FFFFFF/#E8F0FE、selector_git_cloud_card #E8F0FE、colorSurfaceContainer
    /Lowest)→ 深字本就正确,不动

上游权威证据(/home/maple/orca/webhtv):这些项目原本全是亮色 ——
@color/white、@color/white_60/80、@color/selector_video_text(默认项为白)。
dev3 的「统一为 colorOnSurface」才是回归。

关键结论:6 个双上下文布局无需分上下文着色。上游在 dialog_quick_search、
dialog_episode_list、dialog_receive 里复用的正是同一批 item 布局,且同样是
亮色;这两个对话框还是透明窗口 + #66FFFFFF 玻璃面板悬于视频之上。
因此单一恒亮角色在页面与对话框两侧都正确,无需给
ThemeOverlay.WebHTV.Dialog 加重映射(该 overlay 也只挂在 materialAlertDialogTheme
上,够不到 BottomSheetDialogFragment)。

改动:
  15 个仅页面布局 19 处 + 6 个双上下文布局 9 处,共 28 处 android:textColor
  由 ?attr/colorOnSurface 改为 ?attr/webhtvColorOnWallpaper,零结构改动。
  测试:ThemeBaseWiringTest 新增 WALLPAPER_ITEMS 清单(21 项,含上游依据注释),
  并让既有 wallpaperPagesUseTheWallpaperForegroundRole 同时覆盖页面与列表。

Verification: 静态:21 个布局残留 colorOnSurface=0、新引用=28(15 个 19 处 + 6 个 9 处);替换前逐处断言全部落在 android:textColor 上。check_ui_tokens.sh --strict 对比度 38 组 0 失败(min 4.28),唯一 violation item_following.xml 为动手前既有、不在本次变更集。单测::app:testMobileArm64_v8aDebugUnitTest --tests com.fongmi.android.tv.theme.* 与 ui.style.UiStyleSourceTest 全绿(含新清单)。设备:dev3 192.168.50.3:5559 经 scripts/build_arm64_debug_install.sh --flavor mobile 覆盖安装成功,无崩溃(logcat 无 AndroidRuntime/FATAL/InflateException)。实测像素(搜索页芯片 = shape_item_round,背景均匀最适合测量):芯片「中文字幕」底 (115,106,134),白字 5.08:1;芯片「兰香如故」底 (113,104,132),白字 5.23:1;两处若仍用 colorOnSurface(#1A1C1E) 仅 3.37:1 / 3.27:1,不达 WCAG AA 4.5。遗留未测:设备在验证中途掉线(No route to host),直播页 adpter_channel/group/epg_data 与 6 个双上下文布局在对话框内的呈现未取得设备截图;两者均已由上游同款布局+同款亮色与静态检查佐证,但未获本机实测像素。另一处已知同类残留(未处理、需另行授权):这些 item 里作次要文字用的 ?attr/colorOnSurfaceVariant 日间为 #44474F,同样偏暗;仓库无「壁纸上的次要前景色」token,上游对应值是 @color/white_60/80,需要新增语义角色才能修。

Verification: 21 布局残留 0 / 新引用 28;theme.* 与 UiStyleSourceTest 全绿;check_ui_tokens --strict 对比度 38 组 0 失败;dev3 覆盖安装无崩溃;搜索页芯片实测白字 5.08:1/5.23:1(改前口径 3.37:1/3.27:1)

Task-Guard: PAGE-LIST-FOREGROUND-20260929
This commit is contained in:
Silent1566 2026-09-29 14:44:04 +08:00
commit e66a7d3cb4
22 changed files with 53 additions and 29 deletions