Repository navigation
feat(harmonyos): support immersive full screen - #2014
Merged
Merged
Conversation
houko
force-pushed
the
feat/harmony-immersive-1124
branch
from
November 22, 2026 14:31
e0708c8 to
de0f25d
Compare
The status bar item now carries the immersive request to the ArkTS host, which hides the status bar with setWindowSystemBarEnable([]) and the navigation indicator with setSpecificSystemBarEnabled while it is on, and shows both again when it ends. The window is already laid out full screen from launch, so the content keeps running under the bars and their avoid areas report what they cover in either state. The host sets the bars only when the request changes. avoidAreaChange fires when an edge swipe reveals hidden bars for a moment, and setting them again on that event or on the next batch would hide them at once. The safe area now includes the display cutout's avoid area, so a punch-hole camera stays an inset once the status bar over it is hidden, and landscape reports the cutout's left or right inset instead of 0. The committed HAP host is not rebuilt here: no machine at hand has the API 26 SDK that cmd/nsgo/harmony/host/build.sh needs, so TestCommittedHostMatchesTemplates fails until it is run. Refs #1124.
…ion bar The host now forgets the bars it asked for when setWindowSystemBarEnable or setSpecificSystemBarEnabled fails, so the next batch or avoid area change asks again instead of leaving the window in the wrong state. Outside immersive mode the host keeps 'navigation' in setWindowSystemBarEnable, so three-button navigation stays when immersive mode ends or the app hides only its status bar; immersive mode hides it with the other bars. The left and right safe-area insets take the system bars' side avoid areas as well as the cutout's, so a side navigation bar in landscape is an inset. The docs and the mobile.Immersive comment describe what the HarmonyOS host asks the system to do rather than an edge-swipe reveal nobody has checked on a device. The committed HAP host is still not rebuilt: no machine at hand has the API 26 SDK build.sh needs, so TestCommittedHostMatchesTemplates fails until it is run. Refs #1124.
… immersive mode The host tracks the setWindowSystemBarEnable and setSpecificSystemBarEnabled requests on their own. A request is made when what it asks for changes, and a failed one only again for the next batch that carries the status bar, never for an avoid area change. A rejection that arrives after a newer request is ignored. A device that refuses the navigation indicator call therefore no longer makes the bars again on every avoid area change, which hid them right after an edge-swipe reveal. While immersive mode is on, the safe area keeps only the display cutout: bars an edge swipe reveals lie over the content, as on Android, instead of moving the layout as they show and again as they hide. The safe area is read again when immersive mode starts or ends, and the cutout's bottom area now counts, so a punch-hole at the bottom in reverse portrait is an inset. The changelog records that the three-button navigation bar now stays outside immersive mode and that Hidden hides only the status bar. The Immersive comment, the architecture notes and the roadmap row describe the navigation bar and what is still unchecked on a device. Refs #1124.
Built with cmd/nsgo/harmony/host/build.sh, the OpenHarmony 7.0 public SDK (26.0.0.38) and hvigor 6.26.20.
houko
force-pushed
the
feat/harmony-immersive-1124
branch
from
November 23, 2026 00:04
de0f25d to
e510401
Compare
houko
marked this pull request as ready for review
November 23, 2026 00:04
This was referenced Nov 23, 2026
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.
Refs #1124
What
Immersive full screen on HarmonyOS.
StatusBarConfig.Immersivereaches the host as the third value of thesbop.setWindowSystemBarEnable([])andsetSpecificSystemBarEnabled('navigationIndicator', false). When it ends, the host restores the status bar (unlessHiddenis set), the navigation bar and the indicator.setWindowSystemBarEnable(['status'])(or[]forHidden), which always hid the three-button navigation bar. It now keeps'navigation'enabled, so that bar shows on three-button devices, andHiddenhides only the status bar. The changelog records this.EntryAbilityalready lays the window out full screen, so content stays under the bars in both states.setWindowSystemBarEnableandsetSpecificSystemBarEnabled) are tracked separately. Each one is made only when its request changes. Before, the bars were set on every batch andavoidAreaChange, which would hide them again right after an edge-swipe reveal. A failed request is retried only on the next batch that carries the status bar, never onavoidAreaChange. A rejection that arrives after a newer request is ignored. So a device that refuses the navigation indicator call cannot re-hide revealed bars or retry on every frame.TYPE_CUTOUTavoid area on all four sides, so a punch-hole camera stays an inset when the status bar is hidden, including at the bottom in reverse portrait. Outside immersive mode, the system bars' areas (with their side areas in landscape) are insets too. In immersive mode only the cutout counts, so bars revealed by an edge swipe lie over the content, as on Android, and the layout does not jump as they show and hide. The safe area is re-read when immersive mode starts or ends.cmd/nsgo/harmony/host/build.sh, using the OpenHarmony 7.0 public SDK (26.0.0.38) and hvigor 6.26.20. The ArkTS compiles against API 26.Tests
TestStatusBarSendsImmersive(js/wasm).TestHostSystemBarsAndCutout(cmd/nsgo/harmony): a source check that the host reads all four cutout sides, makes the two bar requests through separate trackers, and leaves the bars' areas out while immersive. No test runs the ArkTS itself.cmd/nsgo/harmony: 22 passed, includingTestCommittedHostMatchesTemplates.Still open on #1124
None of these are checked on a HarmonyOS device: bars hiding and coming back, the edge-swipe reveal (including whether the revealed bars change the avoid areas), three-button navigation, the retry behavior when a bar request fails, and cutout insets in both orientations. The physical iPhone and Android API 28/29 checks from #1141 are also still open. The roadmap row lists them.
Screenshots
None. Not captured on a HarmonyOS device.