This commit is contained in:
Fredrik Burmester
2024-11-10 10:13:34 +01:00
parent d95833335e
commit a23e370deb

View File

@@ -1,56 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _configPlugins = require("@expo/config-plugins");
const withAndroidEdgeToEdgeTheme = (config, props) => {
const themes = {
Material2: "Theme.EdgeToEdge.Material2",
Material3: "Theme.EdgeToEdge.Material3"
};
const ignoreList = new Set(["android:enforceNavigationBarContrast", "android:enforceStatusBarContrast", "android:fitsSystemWindows", "android:navigationBarColor", "android:statusBarColor", "android:windowDrawsSystemBarBackgrounds", "android:windowLayoutInDisplayCutoutMode", "android:windowLightNavigationBar", "android:windowLightStatusBar", "android:windowTranslucentNavigation", "android:windowTranslucentStatus"]);
return (0, _configPlugins.withAndroidStyles)(config, config => {
const {
androidStatusBar = {},
userInterfaceStyle = "light"
} = config;
const {
barStyle
} = androidStatusBar;
const {
android = {}
} = props;
const {
parentTheme = "Default"
} = android;
config.modResults.resources.style = config.modResults.resources.style?.map(style => {
if (style.$.name === "AppTheme") {
style.$.parent = themes[parentTheme] ?? "Theme.EdgeToEdge";
if (style.item != null) {
style.item = style.item.filter(item => !ignoreList.has(item.$.name));
}
if (barStyle != null) {
style.item.push({
$: {
name: "android:windowLightStatusBar"
},
_: String(barStyle === "dark-content")
});
} else if (userInterfaceStyle !== "automatic") {
style.item.push({
$: {
name: "android:windowLightStatusBar"
},
_: String(userInterfaceStyle === "light")
});
}
}
return style;
});
return config;
});
};
var _default = exports.default = (0, _configPlugins.createRunOncePlugin)(withAndroidEdgeToEdgeTheme, "react-native-edge-to-edge");
//# sourceMappingURL=expo.js.map