fix(android): status bar black strip fixed #46086
Closed
+11
−0
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:
Fixes these issues:
Changelog:
[ANDROID] [FIXED] - Fixed black strip coming when hiding status bar
setHidden
function is responsible for hiding status barreact-native/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.kt
Line 122 in 25d6a15
What real issue is? For android devices with camera area on top a black strip is coming after hidding status bar.
Previous Implementation:
It seems that FLAG_FULLSCREEN flag are not enough to draw content in camera area.
Solution:
In order to tackle this, android exposes 2 flags:
By adding this flag we are now able to hide status bar properly.
Note: This will work above Android 11 and above
Test Plan:
Device Detail:
Oneplus9 5G OS 11
Before fix:
https://github.com/user-attachments/assets/589098ff-a3fa-4962-a15b-ceacbfd03d2d
After fix:
https://github.com/user-attachments/assets/a87dd8e4-3624-4e09-99da-a14f9e19fcc6