diff --git a/mobile/app.json b/mobile/app.json index 4f034020c..1381fc041 100644 --- a/mobile/app.json +++ b/mobile/app.json @@ -78,6 +78,7 @@ }, "plugins": [ "expo-router", + "./plugins/android-respect-rotation-lock.js", [ "expo-splash-screen", { diff --git a/mobile/app/_layout.tsx b/mobile/app/_layout.tsx index de1160c6b..4572790c9 100644 --- a/mobile/app/_layout.tsx +++ b/mobile/app/_layout.tsx @@ -145,8 +145,12 @@ export default function RootLayout() { headerTintColor: colors.textPrimary, headerTitleStyle: { fontSize: 16, fontWeight: '600' }, contentStyle: { backgroundColor: colors.bgBase }, - headerShadowVisible: false, - orientation: 'all' + headerShadowVisible: false + // Why: deliberately no `orientation` screenOption. react-native-screens + // has no value that respects the device rotation lock — even 'default' + // calls setRequestedOrientation(UNSPECIFIED) at runtime, overriding the + // manifest. Leaving it unset lets the manifest's "fullUser" (set by the + // android-respect-rotation-lock config plugin) honor the auto-rotate lock. }} > { + const activity = AndroidConfig.Manifest.getMainActivityOrThrow(cfg.modResults) + activity.$['android:screenOrientation'] = ANDROID_SCREEN_ORIENTATION + return cfg + }) +}