Skip to content

Commit be4a0b0

Browse files
committed
Only allow nav bar style override if enforceNavigationBarContrast is set to false
1 parent 474df0a commit be4a0b0

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
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.1",
3+
"version": "1.4.2",
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: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,6 @@ const withAndroidEdgeToEdgeTheme: ConfigPlugin<Props> = (
7575
);
7676
}
7777

78-
if (enforceNavigationBarContrast === false) {
79-
style.item.push({
80-
$: { name: "enforceNavigationBarContrast" },
81-
_: String(false),
82-
});
83-
}
84-
8578
if (statusBarStyle != null) {
8679
style.item.push({
8780
$: { name: "android:windowLightStatusBar" },
@@ -94,15 +87,22 @@ const withAndroidEdgeToEdgeTheme: ConfigPlugin<Props> = (
9487
});
9588
}
9689

97-
if (navigationBarStyle != null) {
98-
style.item.push({
99-
$: { name: "android:windowLightNavigationBar" },
100-
_: String(navigationBarStyle === "dark-content"),
101-
});
102-
} else if (userInterfaceStyle !== "automatic") {
90+
if (enforceNavigationBarContrast === false) {
91+
if (navigationBarStyle != null) {
92+
style.item.push({
93+
$: { name: "android:windowLightNavigationBar" },
94+
_: String(navigationBarStyle === "dark-content"),
95+
});
96+
} else if (userInterfaceStyle !== "automatic") {
97+
style.item.push({
98+
$: { name: "android:windowLightNavigationBar" },
99+
_: String(navigationBarStyle === "light"),
100+
});
101+
}
102+
103103
style.item.push({
104-
$: { name: "android:windowLightNavigationBar" },
105-
_: String(navigationBarStyle === "light"),
104+
$: { name: "enforceNavigationBarContrast" },
105+
_: String(false),
106106
});
107107
}
108108
}

0 commit comments

Comments
 (0)