Skip to content

Commit 474df0a

Browse files
committed
Add the ability to override android:windowLightNavigationBar
1 parent e78ad83 commit 474df0a

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-edge-to-edge",
3-
"version": "1.4.0",
3+
"version": "1.4.1",
44
"license": "MIT",
55
"description": "Effortlessly enable edge-to-edge display in React Native",
66
"author": "Mathieu Acthernoene <[email protected]>",

src/expo.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,14 @@ const withAndroidEdgeToEdgeTheme: ConfigPlugin<Props> = (
5353
]);
5454

5555
return withAndroidStyles(config, (config) => {
56-
const { androidStatusBar = {}, userInterfaceStyle = "light" } = config;
57-
const { barStyle } = androidStatusBar;
56+
const {
57+
androidNavigationBar = {},
58+
androidStatusBar = {},
59+
userInterfaceStyle = "light",
60+
} = config;
61+
62+
const { barStyle: navigationBarStyle } = androidNavigationBar;
63+
const { barStyle: statusBarStyle } = androidStatusBar;
5864
const { android = {} } = props;
5965
const { enforceNavigationBarContrast, parentTheme = "Default" } = android;
6066

@@ -76,17 +82,29 @@ const withAndroidEdgeToEdgeTheme: ConfigPlugin<Props> = (
7682
});
7783
}
7884

79-
if (barStyle != null) {
85+
if (statusBarStyle != null) {
8086
style.item.push({
8187
$: { name: "android:windowLightStatusBar" },
82-
_: String(barStyle === "dark-content"),
88+
_: String(statusBarStyle === "dark-content"),
8389
});
8490
} else if (userInterfaceStyle !== "automatic") {
8591
style.item.push({
8692
$: { name: "android:windowLightStatusBar" },
8793
_: String(userInterfaceStyle === "light"),
8894
});
8995
}
96+
97+
if (navigationBarStyle != null) {
98+
style.item.push({
99+
$: { name: "android:windowLightNavigationBar" },
100+
_: String(navigationBarStyle === "dark-content"),
101+
});
102+
} else if (userInterfaceStyle !== "automatic") {
103+
style.item.push({
104+
$: { name: "android:windowLightNavigationBar" },
105+
_: String(navigationBarStyle === "light"),
106+
});
107+
}
90108
}
91109

92110
return style;

0 commit comments

Comments
 (0)