Fix tall image lightbox on Android (#4393)

zio/stable
dan 2024-06-06 15:13:53 +01:00 committed by GitHub
parent 3801932902
commit 559764156d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 8 deletions

View File

@ -1,30 +1,36 @@
import React, {useState} from 'react' import React, {useState} from 'react'
import {ActivityIndicator, Dimensions, StyleSheet} from 'react-native' import {ActivityIndicator, Dimensions, StyleSheet} from 'react-native'
import {Image} from 'expo-image' import {Gesture, GestureDetector} from 'react-native-gesture-handler'
import Animated, { import Animated, {
runOnJS, runOnJS,
useAnimatedReaction,
useAnimatedRef, useAnimatedRef,
useAnimatedStyle, useAnimatedStyle,
useAnimatedReaction,
useSharedValue, useSharedValue,
withDecay, withDecay,
withSpring, withSpring,
} from 'react-native-reanimated' } from 'react-native-reanimated'
import {GestureDetector, Gesture} from 'react-native-gesture-handler' import {Image} from 'expo-image'
import type {Dimensions as ImageDimensions, ImageSource} from '../../@types'
import useImageDimensions from '../../hooks/useImageDimensions' import useImageDimensions from '../../hooks/useImageDimensions'
import { import {
createTransform,
readTransform,
applyRounding, applyRounding,
createTransform,
prependPan, prependPan,
prependPinch, prependPinch,
prependTransform, prependTransform,
readTransform,
TransformMatrix, TransformMatrix,
} from '../../transforms' } from '../../transforms'
import type {ImageSource, Dimensions as ImageDimensions} from '../../@types'
const SCREEN = Dimensions.get('window') const windowDim = Dimensions.get('window')
const screenDim = Dimensions.get('screen')
const statusBarHeight = windowDim.height - screenDim.height
const SCREEN = {
width: windowDim.width,
height: windowDim.height + statusBarHeight,
}
const MIN_DOUBLE_TAP_SCALE = 2 const MIN_DOUBLE_TAP_SCALE = 2
const MAX_ORIGINAL_IMAGE_ZOOM = 2 const MAX_ORIGINAL_IMAGE_ZOOM = 2