An ATproto social media client -- with an independent Appview.
1import * as SystemUI from 'expo-system-ui'
2
3import {logger} from '#/logger'
4import {isAndroid} from '#/platform/detection'
5import {type Theme} from '../types'
6
7export function setSystemUITheme(themeType: 'theme' | 'lightbox', t: Theme) {
8 if (isAndroid) {
9 try {
10 if (themeType === 'theme') {
11 SystemUI.setBackgroundColorAsync(t.atoms.bg.backgroundColor)
12 } else {
13 SystemUI.setBackgroundColorAsync('black')
14 }
15 } catch (error) {
16 // Can reject with 'The current activity is no longer available' - no big deal
17 logger.debug('Could not set system UI theme', {safeMessage: error})
18 }
19 }
20}