[Lightbox] Small tweaks (#6301)

* Tweak lightbox springs

* Speed up dismiss speed

* Don't scroll to top while active lightbox

* Make Android a bit faster
This commit is contained in:
dan
2024-11-13 21:13:07 +00:00
committed by GitHub
parent 3bab7f7540
commit 4ca5267b98
2 changed files with 6 additions and 3 deletions
+3
View File
@@ -8,6 +8,7 @@ import {useDedupe} from '#/lib/hooks/useDedupe'
import {useScrollHandlers} from '#/lib/ScrollContext'
import {addStyle} from '#/lib/styles'
import {isIOS} from '#/platform/detection'
import {useLightbox} from '#/state/lightbox'
import {useTheme} from '#/alf'
import {FlatList_INTERNAL} from './Views'
@@ -52,6 +53,7 @@ function ListImpl<ItemT>(
const isScrolledDown = useSharedValue(false)
const t = useTheme()
const dedupe = useDedupe(400)
const {activeLightbox} = useLightbox()
function handleScrolledDownChange(didScrollDown: boolean) {
onScrolledDownChange?.(didScrollDown)
@@ -143,6 +145,7 @@ function ListImpl<ItemT>(
contentOffset={contentOffset}
refreshControl={refreshControl}
onScroll={scrollHandler}
scrollsToTop={!activeLightbox}
scrollEventThrottle={1}
onViewableItemsChanged={onViewableItemsChanged}
viewabilityConfig={viewabilityConfig}