about summary refs log tree commit diff
path: root/src/alf
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-12-24 20:05:54 +0000
committerGitHub <noreply@github.com>2024-12-24 20:05:54 +0000
commit6c9e1d4837e9e385da5ca0c89c28000ad25c70d8 (patch)
tree8de94bf059fc4065cf228b63f50f23840ceda4d8 /src/alf
parentf05962a4928e5102e6abe773e938ae8ab941a2c4 (diff)
downloadvoidsky-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/alf')
-rw-r--r--src/alf/util/navigationBar.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/alf/util/navigationBar.ts b/src/alf/util/navigationBar.ts
index face86983..cb315f70a 100644
--- a/src/alf/util/navigationBar.ts
+++ b/src/alf/util/navigationBar.ts
@@ -1,4 +1,5 @@
 import * as NavigationBar from 'expo-navigation-bar'
+import * as SystemUI from 'expo-system-ui'
 
 import {isAndroid} from '#/platform/detection'
 import {Theme} from '../types'
@@ -9,10 +10,12 @@ export function setNavigationBar(themeType: 'theme' | 'lightbox', t: Theme) {
       NavigationBar.setBackgroundColorAsync(t.atoms.bg.backgroundColor)
       NavigationBar.setBorderColorAsync(t.atoms.bg.backgroundColor)
       NavigationBar.setButtonStyleAsync(t.name !== 'light' ? 'light' : 'dark')
+      SystemUI.setBackgroundColorAsync(t.atoms.bg.backgroundColor)
     } else {
       NavigationBar.setBackgroundColorAsync('black')
       NavigationBar.setBorderColorAsync('black')
       NavigationBar.setButtonStyleAsync('light')
+      SystemUI.setBackgroundColorAsync('black')
     }
   }
 }