fix: working material3 theme

This commit is contained in:
Fredrik Burmester
2024-11-10 09:21:51 +01:00
parent 65a6ab9972
commit 87092fed48
5 changed files with 85 additions and 8 deletions

View File

@@ -100,7 +100,10 @@
"motionPermission": "Allow Streamyfin to access your device motion for landscape video watching."
}
],
["react-native-edge-to-edge"],
[
"react-native-edge-to-edge",
{ "android": { "parentTheme": "Material3" } }
],
["react-native-bottom-tabs"]
],
"experiments": {

BIN
bun.lockb

Binary file not shown.

15
edge-to-edge-fix.patch Normal file
View File

@@ -0,0 +1,15 @@
--- expo.js.original 2024-11-10 09:08:19
+++ node_modules/react-native-edge-to-edge/dist/commonjs/expo.js 2024-11-10 09:08:23
@@ -19,10 +19,8 @@
const {
barStyle
} = androidStatusBar;
+ const android = props?.android || {};
const {
- android = {}
- } = props;
- const {
parentTheme = "Default"
} = android;
config.modResults.resources.style = config.modResults.resources.style?.map(style => {
\ No newline at end of file

56
expo.js.original Normal file
View File

@@ -0,0 +1,56 @@
"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

View File

@@ -9,7 +9,8 @@
"ios": "expo run:ios",
"web": "expo start --web",
"test": "jest --watchAll",
"lint": "expo lint"
"lint": "expo lint",
"postinstall": "patch-package"
},
"jest": {
"preset": "jest-expo"
@@ -34,12 +35,12 @@
"@types/uuid": "^10.0.0",
"add": "^2.0.6",
"axios": "^1.7.7",
"expo": "~51.0.38",
"expo": "~51.0.39",
"expo-background-fetch": "~12.0.1",
"expo-blur": "~13.0.2",
"expo-build-properties": "~0.12.5",
"expo-constants": "~16.0.2",
"expo-dev-client": "~4.0.27",
"expo-dev-client": "~4.0.29",
"expo-device": "~6.0.2",
"expo-font": "~12.0.10",
"expo-haptics": "~13.0.1",
@@ -49,10 +50,10 @@
"expo-linking": "~6.3.1",
"expo-network": "~6.0.1",
"expo-notifications": "~0.28.19",
"expo-router": "~3.5.23",
"expo-router": "~3.5.24",
"expo-screen-orientation": "~7.0.5",
"expo-sensors": "~13.0.9",
"expo-splash-screen": "~0.27.6",
"expo-splash-screen": "~0.27.7",
"expo-status-bar": "~1.12.1",
"expo-system-ui": "~3.0.7",
"expo-task-manager": "~11.8.2",
@@ -67,10 +68,10 @@
"react-dom": "18.2.0",
"react-native": "0.74.5",
"react-native-awesome-slider": "^2.5.3",
"react-native-bottom-tabs": "^0.3.1",
"react-native-bottom-tabs": "^0.4.0",
"react-native-circular-progress": "^1.4.0",
"react-native-compressor": "^1.8.25",
"react-native-edge-to-edge": "^1.0.1",
"react-native-edge-to-edge": "^1.1.0",
"react-native-gesture-handler": "~2.16.1",
"react-native-get-random-values": "^1.11.0",
"react-native-google-cast": "^4.8.3",
@@ -104,6 +105,8 @@
"@types/react-test-renderer": "^18.0.7",
"jest": "^29.2.1",
"jest-expo": "~51.0.4",
"patch-package": "^8.0.0",
"postinstall-postinstall": "^2.1.0",
"react-test-renderer": "18.2.0",
"typescript": "~5.3.3"
},