Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check for system bars apperance on newer SDKs (#34899)
Summary: As identified in #34350, modals do not honor the system's status bar colors because they may not be set by the deprecated `systemUiVisibility` flags. Unless `android:windowLightStatusBar` is set to true, the default flag is a zero-integer (a.k.a. "dark mode", where the icons show as white). Since the `StatusBar` component is using the new `setSystemBarsAppearance` API, the ModalHost should also infer its status bar settings from the same API. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [Android] [Fixed] - Fixed an issue on Android API 31+ where modals would turn status bar icons white by default Pull Request resolved: #34899 Test Plan: - On a screen with the `StatusBar` bar style set to `dark-content`, the modal also uses white icons - On a screen with the `StatusBar` bar style set to `light-content`, the modal also uses black icons ### Preview Here, I change the `barStyle` from `light-content` to `dark-content` and demonstrate that the proper attributes are retained. The "Before" is a recording from `main` and the "After" is this branch. Notice how in "Before", the status bar is always turning the icons white when the modal opens. |Before|After| |-|-| |![ezgif-5-586e81991d](https://user-images.githubusercontent.com/10366495/194954666-71f69bd6-c02a-4725-9562-e1f5fcfdeddf.gif)|![ezgif-5-b212d7bb01](https://user-images.githubusercontent.com/10366495/194954244-9c205821-1d7f-4630-861b-f5dbe207f7cd.gif)| ## Other considerations There's some argument towards removing this check entirely--the status bar appearance should be derived from the theming and/or the parent activity's settings, thereby removing the need to apply separate styling Reviewed By: lunaleaps Differential Revision: D40243122 Pulled By: lunaleaps fbshipit-source-id: ffa56c7d6a1906f89658f95a12f6bf1cefd5be8e
- Loading branch information