diff options
author | Samuel Newman <mozzius@protonmail.com> | 2024-11-26 23:59:31 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-26 23:59:31 +0000 |
commit | 8825d6b1a7d13e6b3ac0719258d976f3a7cfc454 (patch) | |
tree | 060bca018a53ce5794961f9cbc54f52de315dc7e /src/view/com/lightbox/ImageViewing/index.tsx | |
parent | 2c2d12b3949dfbb26e8fadecfe9dfecfe3f6962d (diff) | |
download | voidsky-8825d6b1a7d13e6b3ac0719258d976f3a7cfc454.tar.zst |
Lightbox status bar behaviour (#6637)
* lightbox status bar * add hideTransitionAnimation="slide" * move navigation bar logic to util
Diffstat (limited to 'src/view/com/lightbox/ImageViewing/index.tsx')
-rw-r--r-- | src/view/com/lightbox/ImageViewing/index.tsx | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/view/com/lightbox/ImageViewing/index.tsx b/src/view/com/lightbox/ImageViewing/index.tsx index 4ba056eb0..e7d158d03 100644 --- a/src/view/com/lightbox/ImageViewing/index.tsx +++ b/src/view/com/lightbox/ImageViewing/index.tsx @@ -8,7 +8,7 @@ // Original code copied and simplified from the link below as the codebase is currently not maintained: // https://github.com/jobtoday/react-native-image-viewing -import React, {useCallback, useState} from 'react' +import React, {useCallback, useEffect, useState} from 'react' import { LayoutAnimation, PixelRatio, @@ -40,6 +40,7 @@ import { useSafeAreaFrame, useSafeAreaInsets, } from 'react-native-safe-area-context' +import {StatusBar} from 'expo-status-bar' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {Trans} from '@lingui/macro' @@ -50,6 +51,8 @@ import {Lightbox} from '#/state/lightbox' import {Button} from '#/view/com/util/forms/Button' import {Text} from '#/view/com/util/text/Text' import {ScrollView} from '#/view/com/util/Views' +import {ios, useTheme} from '#/alf' +import {setNavigationBar} from '#/alf/util/navigationBar' import {PlatformInfo} from '../../../../../modules/expo-bluesky-swiss-army' import {ImageSource, Transform} from './@types' import ImageDefaultHeader from './components/ImageDefaultHeader' @@ -276,8 +279,26 @@ function ImageView({ }, ) + // style nav bar on android + const t = useTheme() + useEffect(() => { + setNavigationBar('lightbox', t) + return () => { + setNavigationBar('theme', t) + } + }, [t]) + return ( <Animated.View style={[styles.container, containerStyle]}> + <StatusBar + animated + style="light" + hideTransitionAnimation="slide" + backgroundColor="black" + // hiding causes layout shifts on android, + // so avoid until we add edge-to-edge mode + hidden={ios(isScaled || !showControls)} + /> <Animated.View style={[styles.backdrop, backdropStyle]} renderToHardwareTextureAndroid |