fix(tv): 启动时自动适配全局缩放并使用不透明上下栏 - #951
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Android TV 在 1920×1080 输出、320 dpi 系统密度下,Flutter 的布局空间只有约 960×540;原 TV 默认缩放 1.2 会进一步放大整套界面。本次让 Android TV 在启动时依据实际输出尺寸和逻辑密度自动选择比例,这类电视会采用 0.5。1080p 以下补偿系统密度,4K 等更高输出保持与 1080p 接近的内容密度,结果限制在 0.5~1.3 并按 0.05 对齐;无效显示参数回退至 1.0。这里使用逻辑密度,不依赖不可靠的物理 PPI。
「设置 → 外观」新增「自动适配界面大小」。没有手动缩放记录的 Android TV 默认启用,每次启动重新计算;已有手动值继续保留。拖动滑块切换为手动模式,重新打开开关即可恢复自动。其他平台保留原默认值。全局缩放现支持 0.5~1.3,缩小时扩大逻辑布局空间,保证页面铺满屏幕并保留屏幕边缘点击区域;媒体库使用原有布局,不再单独限制顶部高度或缩放工具栏。
TV 顶部状态栏、底部菜单栏使用完全不透明的主题底色,并继续跳过背景模糊。保留滑入/滑出动画,移除 TV 透明度动画层。缩放触发布局更新时,音效状态同步延后至当前帧结束,避免构建期间触发 Provider 通知。
Android 调试版使用独立包名
com.aimessoft.nipaplay.debug和「NipaPlay 调试版」名称,可与正式版并行安装。Rust 构建遵循显式target-platform,真机调试不再额外编译 x86 模拟器架构。验证:
git diff --check通过。flutter build apk --debug --target-platform android-arm --no-pub构建成功。实机已知现象:移除透明度层后菜单栏显示改善,但切换至媒体库后仍偶见顶部时钟字符缺失,尚未完全定位。当前不将这一绘制问题标记为已修复。