removed some unnecessary animations

This commit is contained in:
tapframe 2025-08-09 01:24:40 +05:30
parent b2ef847720
commit a49c2c5a56
2 changed files with 3 additions and 24 deletions

View file

@ -844,30 +844,10 @@ const InnerNavigator = ({ initialRouteName }: { initialRouteName?: keyof RootSta
name="Search" name="Search"
component={SearchScreen as any} component={SearchScreen as any}
options={{ options={{
animation: Platform.OS === 'android' ? 'slide_from_right' : 'fade', animation: Platform.OS === 'android' ? 'none' : 'fade',
animationDuration: Platform.OS === 'android' ? 250 : 350, animationDuration: Platform.OS === 'android' ? 0 : 350,
gestureEnabled: true, gestureEnabled: true,
gestureDirection: 'horizontal', gestureDirection: 'horizontal',
...(Platform.OS === 'android' && {
cardStyleInterpolator: ({ current, layouts }: any) => {
return {
cardStyle: {
transform: [
{
translateX: current.progress.interpolate({
inputRange: [0, 1],
outputRange: [layouts.screen.width, 0],
}),
},
],
opacity: current.progress.interpolate({
inputRange: [0, 0.3, 1],
outputRange: [0, 0.85, 1],
}),
},
};
},
}),
contentStyle: { contentStyle: {
backgroundColor: currentTheme.colors.darkBackground, backgroundColor: currentTheme.colors.darkBackground,
}, },

View file

@ -28,7 +28,6 @@ import AsyncStorage from '@react-native-async-storage/async-storage';
import Animated, { import Animated, {
FadeIn, FadeIn,
FadeOut, FadeOut,
SlideInRight,
useAnimatedStyle, useAnimatedStyle,
useSharedValue, useSharedValue,
withTiming, withTiming,
@ -505,7 +504,7 @@ const SearchScreen = () => {
return ( return (
<Animated.View <Animated.View
style={[styles.container, { backgroundColor: currentTheme.colors.darkBackground }]} style={[styles.container, { backgroundColor: currentTheme.colors.darkBackground }]}
entering={Platform.OS === 'android' ? SlideInRight.duration(250) : FadeIn.duration(350)} entering={Platform.OS === 'android' ? undefined : FadeIn.duration(350)}
exiting={Platform.OS === 'android' ? exiting={Platform.OS === 'android' ?
FadeOut.duration(200).withInitialValues({ opacity: 1 }) : FadeOut.duration(200).withInitialValues({ opacity: 1 }) :
FadeOut.duration(250) FadeOut.duration(250)