Skip to content

Commit 7324b92

Browse files
luluwu2032facebook-github-bot
authored andcommitted
Change StatusBar default style handling strategy
Summary: Changelog: [Android] - Change StatusBar style handling strategy Previously Android status bar can set to `dark-content` or `default`, I made the following changes: - Added `light-content` to get align with iOS - Changed the behavior of `default` from setting status bar with 'SYSTEM_UI_FLAG_LIGHT_STATUS_BAR' to not doing anything, I did this because 1, `setStyle('default')` is found called even without explicitly declared <StatusBar> on that surface, which I think should fail silently 2, my idea is that user should set status bar style to `dark-content` or `light-content` explicitly instead of using `default`. - Fixed the bug found in Dating Settings's Second Look. Reviewed By: RSNara Differential Revision: D24714152 fbshipit-source-id: 76e7d0d45fd3b8c3733efaee81426f5f449cc7d8
1 parent b141dd7 commit 7324b92

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

Libraries/Components/StatusBar/NativeStatusBarManagerAndroid.js

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const NativeStatusBarManager = {
5555
/**
5656
* - statusBarStyles can be:
5757
* - 'default'
58+
* - 'light-content'
5859
* - 'dark-content'
5960
*/
6061
setStyle(statusBarStyle?: ?string): void {

Libraries/Components/StatusBar/StatusBar.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import NativeStatusBarManagerIOS from './NativeStatusBarManagerIOS';
2525
*/
2626
export type StatusBarStyle = $Keys<{
2727
/**
28-
* Default status bar style (dark for iOS, light for Android)
28+
* Default status bar style (dark for iOS, no change for Android)
2929
*/
3030
default: string,
3131
/**

ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public void run() {
194194
int systemUiVisibilityFlags = decorView.getSystemUiVisibility();
195195
if ("dark-content".equals(style)) {
196196
systemUiVisibilityFlags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
197-
} else {
197+
} else if ("light-content".equals(style)) {
198198
systemUiVisibilityFlags &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
199199
}
200200
decorView.setSystemUiVisibility(systemUiVisibilityFlags);

0 commit comments

Comments
 (0)