Lightbox status bar behaviour (#6637)
* lightbox status bar * add hideTransitionAnimation="slide" * move navigation bar logic to util
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user