Created
August 28, 2018 10:54
-
-
Save Maluen/90c7d5ff9d866a312690fa2f68814b57 to your computer and use it in GitHub Desktop.
Extracted from https://github.com/Maluen/react-native-calculator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
startResetAnimation = () => { | |
this.resetAnimation = Animated.timing(this.state.screenOpacityAnim, { | |
toValue: 0, | |
duration: 500, | |
}); | |
this.resetAnimationFinished = false; | |
this.resetAnimation.start(({ finished }) => { | |
if (finished) { | |
this.resetAnimationFinished = true; | |
} | |
}); | |
} | |
cancelResetAnimation = () => { | |
this.resetAnimation.stop(); | |
this.state.screenOpacityAnim.setValue(1); | |
} | |
finalizeResetAnimation = () => { | |
if (this.resetAnimationFinished) { | |
this.handleReset().then(() => { | |
this.state.screenOpacityAnim.setValue(1); | |
}); | |
} else { | |
this.cancelResetAnimation(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment