MCPcopy Index your code
hub / github.com/halilb/react-native-textinput-effects / _toggle

Function _toggle

lib/Jiro.js:40–78  ·  view source on GitHub ↗
(isActive)

Source from the content-addressed store, hash-verified

38 }
39
40 _toggle(isActive) {
41 const animationValue = isActive ? 1 : 0;
42 const borderPositionAnimation = Animated.timing(
43 this.state.borderPositionAnim,
44 {
45 toValue: animationValue,
46 eaasing: Easing.bezier(0.2, 1, 0.3, 1),
47 duration: 200,
48 useNativeDriver: false,
49 }
50 );
51 const borderHeightAnimation = Animated.timing(this.state.borderHeightAnim, {
52 toValue: animationValue,
53 eaasing: Easing.ease,
54 duration: 200,
55 useNativeDriver: false,
56 });
57 const labelPositionAnimation = Animated.timing(
58 this.state.labelPositionAnim,
59 {
60 toValue: animationValue,
61 eaasing: Easing.ease,
62 duration: 200,
63 useNativeDriver: false,
64 }
65 );
66
67 if (isActive) {
68 Animated.sequence([
69 borderPositionAnimation,
70 Animated.parallel([labelPositionAnimation, borderHeightAnimation]),
71 ]).start();
72 } else {
73 Animated.sequence([
74 borderHeightAnimation,
75 Animated.parallel([borderPositionAnimation, labelPositionAnimation]),
76 ]).start();
77 }
78 }
79
80 render() {
81 const {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected