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 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';
|
import { useTheme } from './themes';
|
||||||
|
|
||||||
if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) {
|
if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) {
|
||||||
@ -43,8 +43,13 @@ const SegmentedControl: React.FC<SegmentedControlProps> = ({ values, selectedInd
|
|||||||
});
|
});
|
||||||
|
|
||||||
const handleTabPress = (index: number) => {
|
const handleTabPress = (index: number) => {
|
||||||
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
Animated.timing(animatedValue, {
|
||||||
onChange(index);
|
toValue: index,
|
||||||
|
duration: 300,
|
||||||
|
useNativeDriver: false,
|
||||||
|
}).start(() => {
|
||||||
|
onChange(index);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const tabWidth = animatedValue.interpolate({
|
const tabWidth = animatedValue.interpolate({
|
||||||
|
Loading…
Reference in New Issue
Block a user