0
Fork 0
mirror of https://github.com/Silent1566/webhtv.git synced 2026-10-18 07:09:16 +00:00

fix(ui): give standalone dialog inputs their own box again

The unification commit moved the TMDB/AI input fields from Widget.WebHTV.LightDialog.Input to Widget.WebHTV.Input, whose parent was Widget.Material3.TextInputLayout.OutlinedBox - a TextInputLayout container style that draws the outline on the container and reserves space for a floating label. Two facts made that a total failure: none of those layouts contains a TextInputLayout (19 bare TextInputEditText fields across dialog_tmdb_source, dialog_ai_config, dialog_ai_prompt_config and dialog_group_rule_edit), so nothing drew a border at all; and the style it replaced was the one carrying android:background=@drawable/selector_dialog_input plus the text size, colour and cursor. The result was exactly what was reported - borderless fields whose text is squeezed and clipped inside their fixed 44dp heights. Widget.WebHTV.Input is now a standalone field style with no container parent, drawing @drawable/selector_dialog_input (whose focused and default states resolve through ?attr/colorPrimary, ?attr/colorOutline and ?attr/colorSurfaceContainerHighest) and setting ?attr/colorOnSurface text, ?attr/colorOnSurfaceVariant hints, the themed cursor drawable and 14sp - the same shape the tree already uses correctly elsewhere, such as the bare AppCompatEditText fields in dialog_ad_block_stats, with no new resources. UiStyleSourceTest#standaloneInputStyleProvidesItsOwnBox parses the style and fails if it regains a TextInputLayout parent or loses its own box and text colour. Verified on dev3 192.168.50.3:5559 by real taps: Settings > TMDB > TMDB data configuration now shows bordered fields with the full API key, language, API host and image host no longer clipped, and Settings > AI service > AI general configuration shows the same recovery - FATAL EXCEPTION stayed 0 in both, confirming a class-wide fix rather than a one-off. The style unit tests pass. Documentation for this fix lives in a separate commit because it falls outside this session's declared scope.

Task-Guard: THEME-INPUT-STYLE-REGRESSION-20260926

Verification: 修复 4.31 输入框无边框且文字裁切。根因(0af2340d4 引入):该提交把 TMDB/AI 等布局的输入框样式从 Widget.WebHTV.LightDialog.Input 换成 Widget.WebHTV.Input,而后者父样式是 Widget.Material3.TextInputLayout.OutlinedBox——这是给 TextInputLayout 容器用的样式,描边由容器绘制、内边距为浮动标签预留。但 (1) 这些布局里根本没有 TextInputLayout(dialog_tmdb_source/dialog_ai_config/dialog_ai_prompt_config/dialog_group_rule_edit 共 19 处全是裸 TextInputEditText),没有任何东西画边框;(2) 被替换掉的旧样式恰恰含 android:background=@drawable/selector_dialog_input(可见输入框外观)以及 textSize/textColor/cursor。两者叠加 = 无边框 + 文字在固定 44dp 高度里被挤压裁切,与用户截图一致。修复:Widget.WebHTV.Input 改为独立输入框样式(不再继承任何容器样式),自带 android:background=@drawable/selector_dialog_input(焦点/默认两态,颜色为 ?attr/colorPrimary / ?attr/colorOutline / ?attr/colorSurfaceContainerHighest)、android:textColor=?attr/colorOnSurface、android:textColorHint=?attr/colorOnSurfaceVariant、@drawable/shape_cursor_dialog、14sp;该写法与仓库既有正确做法一致(dialog_ad_block_stats 三套 source set 的独立输入框就是裸 AppCompatEditText + 同一 drawable),未新增资源。守门测试 UiStyleSourceTest#standaloneInputStyleProvidesItsOwnBox:解析 Widget.WebHTV.Input 定义,断言父样式不得含 TextInputLayout、必须自带 @drawable/selector_dialog_input、必须自带 android:textColor。设备验证(dev3 192.168.50.3:5559,覆盖安装,真实点击路径):设置→TMDB→「TMDB 数据配置」输入框恢复可见圆角边框,API Key 304ca56b1b7b57ca7a47d9b59946be94、语言 zh-CN、API 域名、图片域名均完整显示不再裁切,排版正常,FATAL EXCEPTION=0;设置→AI 服务→「AI 通用配置」同类输入框同样恢复边框与完整文字,FATAL=0,证明是整类修复而非单点。自动化::app:testMobileArm64_v8aDebugUnitTest --tests 'com.fongmi.android.tv.ui.style.*' BUILD SUCCESSFUL。注:本次提交只含代码与测试;配套文档 4.31 记录因超出本会话声明范围,已另存为 /tmp/doc_431.patch 待下个文档任务提交。

Task-Guard: THEME-INPUT-STYLE-REGRESSION-20260926
This commit is contained in:
Silent1566 2026-09-26 12:41:03 +08:00
commit 336c471b8c
2 changed files with 49 additions and 4 deletions