diff options
author | Samuel Newman <mozzius@protonmail.com> | 2024-12-24 20:05:54 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-24 20:05:54 +0000 |
commit | 6c9e1d4837e9e385da5ca0c89c28000ad25c70d8 (patch) | |
tree | 8de94bf059fc4065cf228b63f50f23840ceda4d8 /src/App.native.tsx | |
parent | f05962a4928e5102e6abe773e938ae8ab941a2c4 (diff) | |
download | voidsky-6c9e1d4837e9e385da5ca0c89c28000ad25c70d8.tar.zst |
Unlock orientation when lightbox is open (#7257)
* unlock orientation when lightbox is open * rm outer safe area view, make sure alt text is safe * restore safe area view for android 14 and below * lock orientation on launch for android * set system ui background to black when lightbox is open * reset state on relayout * catch async functions with noops * rm superfluous catches * Delay unlock until after animation * Simplify how key is determined * Make landscape backdrop opaque --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
Diffstat (limited to 'src/App.native.tsx')
-rw-r--r-- | src/App.native.tsx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/App.native.tsx b/src/App.native.tsx index 780295ddc..d1d6b7213 100644 --- a/src/App.native.tsx +++ b/src/App.native.tsx @@ -10,6 +10,7 @@ import { initialWindowMetrics, SafeAreaProvider, } from 'react-native-safe-area-context' +import * as ScreenOrientation from 'expo-screen-orientation' import * as SplashScreen from 'expo-splash-screen' import * as SystemUI from 'expo-system-ui' import {msg} from '@lingui/macro' @@ -22,7 +23,7 @@ import {s} from '#/lib/styles' import {ThemeProvider} from '#/lib/ThemeContext' import I18nProvider from '#/locale/i18nProvider' import {logger} from '#/logger' -import {isIOS} from '#/platform/detection' +import {isAndroid, isIOS} from '#/platform/detection' import {Provider as A11yProvider} from '#/state/a11y' import {Provider as MutedThreadsProvider} from '#/state/cache/thread-mutes' import {Provider as DialogStateProvider} from '#/state/dialogs' @@ -77,6 +78,10 @@ SplashScreen.preventAutoHideAsync() if (isIOS) { SystemUI.setBackgroundColorAsync('black') } +if (isAndroid) { + // iOS is handled by the config plugin -sfn + ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.PORTRAIT_UP) +} /** * Begin geolocation ASAP |