Skip to content

Commit f14c13e

Browse files
committed
Allow Expo androidStatusBar barStyle to override the android:windowLightStatusBar attribute
1 parent 62ef3fc commit f14c13e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

package.json

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

src/expo.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ const withAndroidEdgeToEdgeTheme: ConfigPlugin = (config) => {
2020
]);
2121

2222
return withAndroidStyles(config, (config) => {
23-
const { userInterfaceStyle = "light" } = config;
23+
const { androidStatusBar = {}, userInterfaceStyle = "light" } = config;
24+
const { barStyle } = androidStatusBar;
2425

2526
config.modResults.resources.style = config.modResults.resources.style?.map(
2627
(style): typeof style => {
@@ -33,7 +34,12 @@ const withAndroidEdgeToEdgeTheme: ConfigPlugin = (config) => {
3334
);
3435
}
3536

36-
if (userInterfaceStyle !== "automatic") {
37+
if (barStyle != null) {
38+
style.item.push({
39+
$: { name: "android:windowLightStatusBar" },
40+
_: String(barStyle === "dark-content"),
41+
});
42+
} else if (userInterfaceStyle !== "automatic") {
3743
style.item.push({
3844
$: { name: "android:windowLightStatusBar" },
3945
_: String(userInterfaceStyle === "light"),

0 commit comments

Comments
 (0)