Stop syncing Modal system bars from Activity on Android#56916
Open
zoontek wants to merge 1 commit into
Open
Conversation
|
@alanleedev has imported this pull request. If you are a Meta employee, you can view this in D106013785. |
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.
Summary:
This PR removes
updateSystemAppearance()andsyncSystemBarsVisibility()along with their now-unused imports.On Android, every time a
<Modal>is shown,ReactModalHostView.updateSystemAppearance()reaches into the host activity'sWindowInsetsControllerand copies its status bar / navigation bar style and visibility onto the dialog window. This was the only way to keep modal windows visually consistent with the activity, since native modules likeStatusBarModuleonly operated on the activity window.This is now obsolete:
ExtraWindowEventListenerinterface, letting native modules be notified when extraWindows (e.g. modal dialogs) are created and destroyed.StatusBarModuleimplement that interface, so status bar style and visibility now sync to modal windows directly from the module that owns them.The navigation bar half of
updateSystemAppearance()is owned by third-party libraries (expo-navigation-bar,@zoontek/react-native-navigation-bar). Their next releases will implementExtraWindowEventListenerthe same wayStatusBarModuledoes, syncing nav bar style and visibility to modal windows from the module that owns them.At that point
updateSystemAppearance()is fully redundant: every concern it covered is handled by the module responsible for that configuration.Changelog:
[ANDROID] [REMOVED] - Remove manual system bar sync from
ReactModalHostView; modal windows are now configured by modules implementingExtraWindowEventListener(e.g.StatusBarModule).Test Plan:
<Modal>on Android and confirm the status bar style matches the host activity (light / dark content), now driven byStatusBarModule'sExtraWindowEventListener.<StatusBar barStyle="light-content" />/"dark-content"while a modal is open and confirm the change applies to the dialog window.<StatusBar hidden />before and during a modal presentation and confirm the dialog stays in sync with the activity.