(isActive)
| 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 { |
nothing calls this directly
no outgoing calls
no test coverage detected