From 559764156d707aaf874753546db74572b81f1271 Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 6 Jun 2024 15:13:53 +0100 Subject: [PATCH] Fix tall image lightbox on Android (#4393) --- .../ImageItem/ImageItem.android.tsx | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx b/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx index 414f98a6..814e39fa 100644 --- a/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx +++ b/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx @@ -1,30 +1,36 @@ import React, {useState} from 'react' - import {ActivityIndicator, Dimensions, StyleSheet} from 'react-native' -import {Image} from 'expo-image' +import {Gesture, GestureDetector} from 'react-native-gesture-handler' import Animated, { runOnJS, + useAnimatedReaction, useAnimatedRef, useAnimatedStyle, - useAnimatedReaction, useSharedValue, withDecay, withSpring, } 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 { - createTransform, - readTransform, applyRounding, + createTransform, prependPan, prependPinch, prependTransform, + readTransform, TransformMatrix, } 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 MAX_ORIGINAL_IMAGE_ZOOM = 2