An ATproto social media client -- with an independent Appview.
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix stuck lightbox header after double tap (#1627)

authored by

dan and committed by
GitHub
d2f11f8e 3b78d322

+14 -9
+14 -9
src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx
··· 61 61 const dismissSwipeTranslateY = useSharedValue(0) 62 62 const containerRef = useAnimatedRef() 63 63 64 - function getCommittedScale(): number { 65 - 'worklet' 66 - const [, , committedScale] = readTransform(committedTransform.value) 67 - return committedScale 68 - } 69 - 70 64 // Keep track of when we're entering or leaving scaled rendering. 65 + // Note: DO NOT move any logic reading animated values outside this function. 71 66 useAnimatedReaction( 72 67 () => { 73 - return pinchScale.value !== 1 || getCommittedScale() !== 1 68 + if (pinchScale.value !== 1) { 69 + // We're currently pinching. 70 + return true 71 + } 72 + const [, , committedScale] = readTransform(committedTransform.value) 73 + if (committedScale !== 1) { 74 + // We started from a pinched in state. 75 + return true 76 + } 77 + // We're at rest. 78 + return false 74 79 }, 75 80 (nextIsScaled, prevIsScaled) => { 76 81 if (nextIsScaled !== prevIsScaled) { ··· 169 174 } 170 175 // Don't let the picture zoom in so close that it gets blurry. 171 176 // Also, like in stock Android apps, don't let the user zoom out further than 1:1. 172 - const committedScale = getCommittedScale() 177 + const [, , committedScale] = readTransform(committedTransform.value) 173 178 const maxCommittedScale = 174 179 (imageDimensions.width / SCREEN.width) * MAX_ORIGINAL_IMAGE_ZOOM 175 180 const minPinchScale = 1 / committedScale ··· 256 261 if (!imageDimensions) { 257 262 return 258 263 } 259 - const committedScale = getCommittedScale() 264 + const [, , committedScale] = readTransform(committedTransform.value) 260 265 if (committedScale !== 1) { 261 266 // Go back to 1:1 using the identity vector. 262 267 let t = createTransform()