diff --git a/src/components/DraggableList/index.tsx b/src/components/DraggableList/index.tsx index 78b893b698..812e364f50 100644 --- a/src/components/DraggableList/index.tsx +++ b/src/components/DraggableList/index.tsx @@ -3,6 +3,7 @@ import {Gesture, GestureDetector} from 'react-native-gesture-handler' import Animated, { type AnimatedRef, measure, + Reanimated3DefaultSpringConfig, runOnJS, scrollTo, type SharedValue, @@ -370,18 +371,18 @@ function SortableItem({ return { transform: [ {translateY: s.dragStartSlot * itemHeight + dragY.get()}, - {scale: withSpring(1.03)}, + {scale: withSpring(1.03, Reanimated3DefaultSpringConfig)}, ], zIndex: 999, ...(IS_IOS ? { shadowColor: '#000', shadowOffset: {width: 0, height: 1}, - shadowOpacity: withSpring(0.08), - shadowRadius: withSpring(4), + shadowOpacity: withSpring(0.08, Reanimated3DefaultSpringConfig), + shadowRadius: withSpring(4, Reanimated3DefaultSpringConfig), } : { - elevation: withSpring(3), + elevation: withSpring(3, Reanimated3DefaultSpringConfig), }), } } @@ -391,11 +392,11 @@ function SortableItem({ const inactive = { ...(IS_IOS ? { - shadowOpacity: withSpring(0), - shadowRadius: withSpring(0), + shadowOpacity: withSpring(0, Reanimated3DefaultSpringConfig), + shadowRadius: withSpring(0, Reanimated3DefaultSpringConfig), } : { - elevation: withSpring(0), + elevation: withSpring(0, Reanimated3DefaultSpringConfig), }), } @@ -425,7 +426,7 @@ function SortableItem({ return { transform: [ {translateY: withTiming(baseY + offset, {duration: 200})}, - {scale: withSpring(1)}, + {scale: withSpring(1, Reanimated3DefaultSpringConfig)}, ], zIndex: 0, ...inactive, diff --git a/src/components/Lightbox/pager/ImageItem/ImageItem.android.tsx b/src/components/Lightbox/pager/ImageItem/ImageItem.android.tsx index 62e28523a7..b27e2d9aba 100644 --- a/src/components/Lightbox/pager/ImageItem/ImageItem.android.tsx +++ b/src/components/Lightbox/pager/ImageItem/ImageItem.android.tsx @@ -7,6 +7,7 @@ import { } from 'react-native-gesture-handler' import Animated, { type AnimatableValue, + Reanimated3DefaultSpringConfig, runOnJS, type SharedValue, useAnimatedReaction, @@ -463,7 +464,10 @@ function clampTranslation( function withClampedSpring(value: T): T { 'worklet' - return withSpring(value, {overshootClamping: true}) + return withSpring(value, { + ...Reanimated3DefaultSpringConfig, + overshootClamping: true, + }) } export default memo(ImageItem) diff --git a/src/components/Lightbox/pager/ImagePager.tsx b/src/components/Lightbox/pager/ImagePager.tsx index 94a39022e7..a0ed0c59b2 100644 --- a/src/components/Lightbox/pager/ImagePager.tsx +++ b/src/components/Lightbox/pager/ImagePager.tsx @@ -605,8 +605,8 @@ function LightboxImage({ dismissSwipeTranslateY.set(() => { 'worklet' return withSpring(0, { - stiffness: 700, - damping: 50, + stiffness: 2800, + damping: 200, reduceMotion: ReduceMotion.Never, }) }) diff --git a/src/state/shell/minimal-mode.tsx b/src/state/shell/minimal-mode.tsx index 2572ccc719..2309b6fa1b 100644 --- a/src/state/shell/minimal-mode.tsx +++ b/src/state/shell/minimal-mode.tsx @@ -7,6 +7,7 @@ import { useRef, } from 'react' import { + Reanimated3DefaultSpringConfig, type SharedValue, useSharedValue, withSpring, @@ -34,6 +35,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) { 'worklet' footerMode.set(() => withSpring(v ? 1 : 0, { + ...Reanimated3DefaultSpringConfig, overshootClamping: true, }), ) diff --git a/src/view/com/util/MainScrollProvider.tsx b/src/view/com/util/MainScrollProvider.tsx index 1a0580ea4e..ccab7cb992 100644 --- a/src/view/com/util/MainScrollProvider.tsx +++ b/src/view/com/util/MainScrollProvider.tsx @@ -3,6 +3,7 @@ import {type NativeScrollEvent} from 'react-native' import { clamp, interpolate, + Reanimated3DefaultSpringConfig, type SharedValue, useAnimatedStyle, useSharedValue, @@ -105,6 +106,7 @@ export function MainScrollProvider({children}: {children: React.ReactNode}) { 'worklet' headerMode.set(() => withSpring(v ? 1 : 0, { + ...Reanimated3DefaultSpringConfig, overshootClamping: true, }), ) diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx index eeb77e64b0..d3495bbd04 100644 --- a/src/view/screens/Home.tsx +++ b/src/view/screens/Home.tsx @@ -1,6 +1,9 @@ import {useCallback, useEffect, useLayoutEffect, useMemo, useRef} from 'react' import {ActivityIndicator, StyleSheet} from 'react-native' -import {withSpring} from 'react-native-reanimated' +import { + Reanimated3DefaultSpringConfig, + withSpring, +} from 'react-native-reanimated' import {useFocusEffect} from '@react-navigation/native' import {PROD_DEFAULT_FEED} from '#/lib/constants' @@ -147,7 +150,12 @@ function HomeScreenReady({ const headerMode = useHomeHeaderMode() const showHeader = useCallback(() => { 'worklet' - headerMode.set(() => withSpring(0, {overshootClamping: true})) + headerMode.set(() => + withSpring(0, { + ...Reanimated3DefaultSpringConfig, + overshootClamping: true, + }), + ) }, [headerMode]) useFocusEffect(