Skip to content

Commit

Permalink
Only allow nav bar style override if enforceNavigationBarContrast is …
Browse files Browse the repository at this point in the history
…set to false
  • Loading branch information
zoontek committed Jan 19, 2025
1 parent 474df0a commit be4a0b0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-edge-to-edge",
"version": "1.4.1",
"version": "1.4.2",
"license": "MIT",
"description": "Effortlessly enable edge-to-edge display in React Native",
"author": "Mathieu Acthernoene <zoontek@gmail.com>",
Expand Down
30 changes: 15 additions & 15 deletions src/expo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,6 @@ const withAndroidEdgeToEdgeTheme: ConfigPlugin<Props> = (
);
}

if (enforceNavigationBarContrast === false) {
style.item.push({
$: { name: "enforceNavigationBarContrast" },
_: String(false),
});
}

if (statusBarStyle != null) {
style.item.push({
$: { name: "android:windowLightStatusBar" },
Expand All @@ -94,15 +87,22 @@ const withAndroidEdgeToEdgeTheme: ConfigPlugin<Props> = (
});
}

if (navigationBarStyle != null) {
style.item.push({
$: { name: "android:windowLightNavigationBar" },
_: String(navigationBarStyle === "dark-content"),
});
} else if (userInterfaceStyle !== "automatic") {
if (enforceNavigationBarContrast === false) {
if (navigationBarStyle != null) {
style.item.push({
$: { name: "android:windowLightNavigationBar" },
_: String(navigationBarStyle === "dark-content"),
});
} else if (userInterfaceStyle !== "automatic") {
style.item.push({
$: { name: "android:windowLightNavigationBar" },
_: String(navigationBarStyle === "light"),
});
}

style.item.push({
$: { name: "android:windowLightNavigationBar" },
_: String(navigationBarStyle === "light"),
$: { name: "enforceNavigationBarContrast" },
_: String(false),
});
}
}
Expand Down

0 comments on commit be4a0b0

Please sign in to comment.