Repository navigation
fix(ohos): 修复小窗/自由多窗与沉浸顶栏下的遮挡;将顶部避让改为原生自行上报 - #181
Merged
HelloZeroNick merged 1 commit intoSep 20, 2026
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.
问题
切到 Flutter 3.44.9 后:
原因
af6c8ca176a(2026-09-08,3.41/3.44 均含)改了setEnabledSystemUIOverlays路径:小窗没有三键/不支持装饰栏时直接setPaddingTop(0),不再回落到系统避让区;运行中打开自由多窗时窗口状态仍是 FLOATING,没有事件触发重算,钉住的 0 一直保留。RefreshLayout后,RefreshIndicator.edgeOffset不再被使用,沉浸顶栏传入的下移量失效。修改
HarmonyChannel.ets:新增顶部避让上报,取系统顶部避让区与自由窗口三键高度的 max,监听三键区域/窗口状态/避让区/窗口尺寸变化推送给 Dart。harmony_channel.dart/main.dart:新增decorTopInset,在根 MediaQuery 的mergeCutout里与padding.top取 max;新增rootTopInset供 Scaffold body 内部取根视图顶部避让(body 内 MediaQuery 顶部已被 Scaffold 移除)。native_top_spacer.dart:沉浸顶栏留白与刷新指示器偏移改用rootTopInset。refresh_layout.dart/refresh_indicator.dart:补回edgeOffset(指示器位置与裁剪区整体下移)。非自由窗口下上报值与 embedding 正常算出的
viewPadding.top同源,取 max 不改变现有行为。