mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 01:40:12 +01:00
FIX: Smoother animation
This commit is contained in:
parent
32099e2bff
commit
89742af8b2
@ -1,5 +1,5 @@
|
||||
import React, { useRef, useEffect } from 'react';
|
||||
import { StyleSheet, Text, View, Pressable, LayoutAnimation, Platform, UIManager, ViewStyle, TextStyle, Animated } from 'react-native';
|
||||
import { StyleSheet, Text, View, Pressable, Platform, UIManager, ViewStyle, TextStyle, Animated } from 'react-native';
|
||||
import { useTheme } from './themes';
|
||||
|
||||
if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) {
|
||||
@ -43,8 +43,13 @@ const SegmentedControl: React.FC<SegmentedControlProps> = ({ values, selectedInd
|
||||
});
|
||||
|
||||
const handleTabPress = (index: number) => {
|
||||
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
||||
onChange(index);
|
||||
Animated.timing(animatedValue, {
|
||||
toValue: index,
|
||||
duration: 300,
|
||||
useNativeDriver: false,
|
||||
}).start(() => {
|
||||
onChange(index);
|
||||
});
|
||||
};
|
||||
|
||||
const tabWidth = animatedValue.interpolate({
|
||||
|
Loading…
Reference in New Issue
Block a user