0
Fork 0
mirror of https://github.com/Silent1566/webhtv.git synced 2026-10-08 19:44:46 +00:00

fix(detail): 修复线路/选集 chip 无底色并恢复光影剧幕浅色白色中间层

用户报告两个问题:
1. 电视版「线路」「选集」chip 只剩描边、没有底色,压在亮色剧照上看不清;
2. 「光影剧幕」浅色模式要改回早之前有白色中间层的版本,和深色模式差不多。

chip 无底色:setChipState 用 MaterialButton#setBackgroundColor,该方法只 tint 当前那个
MaterialShapeDrawable 实例,不更新 helper 的 backgroundTint 字段;Material 之后在 inset/
圆角/尺寸变化时用该字段重建背景,填充因此丢回全透明。同一页的「第 N 季」按钮走
setBackgroundTintList(写持久字段)所以一直有底色,构成截图里的天然 A/B 对照。
改用 setBackgroundTintList。

浅色剧幕:cinemaBackdropShade() 是夹在剧照与内容之间的全屏渐变中间层,深色一直是黑幕,
浅色那层此前被改成全透明,内容直接浮在剧照原图上。恢复 cinemaLightBackdropShade() 并接回
浅色分支,删除为绕开该缺失而引入的局部羽化底板 applyLightCinemaCopyPlate()/
LightCinemaCopyPlateDrawable。同时 tintTmdbSectionTitles() 原先不分深浅一律强制白字,
在白色中间层上会看不见,改为仅深色剧幕强制白字、浅色剧幕使用调色板深色。

新增契约测试:TmdbDetailChipFillTest 用真实渲染证明两条通道在背景重建后的差异;
TmdbCinemaLightReadabilityTest 从生产源码读取中间层 alpha 做 WCAG 对比度断言。

Verification: TmdbDetailChipFillTest 2/2 passed (real-render proof: tint channel keeps chip fill through Material background rebuild; legacy setBackgroundColor degrades to 0x00000000); TmdbCinemaLightReadabilityTest 4/4 passed (reads shipped middle-layer alphas from production source; WCAG contrast >=4.5:1 for title/body; mutation check weakening alpha 0x99->0x1A drops title contrast to 2.95:1 and fails 3 assertions); TmdbDetailActivityLayoutTest 130/130; TmdbCinemaThemeTest 4/4; :app:testMobileArm64_v8aDebugUnitTest 5196 tests 0 failures; :app:testLeanbackArm64_v8aDebugUnitTest 4348 tests 0 failures; leanback arm64 debug APK built (196M) and disassembly confirms setChipState calls MaterialButton.setBackgroundTintList with no setBackgroundColor, cinemaLightBackdropShade present, LightCinemaCopyPlateDrawable removed. Device verification NOT obtained: dev1 emulator 192.168.50.3:5555 was offline for the whole task (port closed; 5557/5559/5561 belong to other devs and were not taken; no local emulator/AVD and no SSH/docker/virsh path to restart it).

Task-Guard: CINEMA-LIGHT-CHIP-FILL-20261006
This commit is contained in:
Silent1566 2026-10-06 19:27:59 +08:00
commit 5c95aa19cd
5 changed files with 565 additions and 102 deletions