Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save HerbertLim/3cf1bdf2107ac58addddddcf1e3d3f98 to your computer and use it in GitHub Desktop.
Save HerbertLim/3cf1bdf2107ac58addddddcf1e3d3f98 to your computer and use it in GitHub Desktop.
/*
* Better way to show and hide window
*/
Animated.sequence([
Animated.parallel([ // 윈도우를 슬라이드인, 페이드인 한다.
Animated.timing(
this.state.fadeAnim,
{
toValue: 1,
duration: isAndroid ? androidDuration : iosDuration,
easing: Easing.in(),
useNativeDriver,
}
),
Animated.timing(
this.state.transY,
{
toValue: shouldFix ? 0 : -visibleWindowHeight,
duration: isAndroid ? androidDuration : iosDuration,
easing: Easing.elastic(),
useNativeDriver,
}
)
]),
Animated.delay(4000),
Animated.parallel([
Animated.timing(
this.state.fadeAnim,
{
toValue: 0.01,
duration: isAndroid ? androidDuration : iosDuration,
easing: Easing.back(),
useNativeDriver,
}
),
Animated.timing(
this.state.transY,
{
toValue: 0,
duration: isAndroid ? androidDuration : iosDuration,
easing: Easing.back(),
useNativeDriver,
}
)
]),
]).start( () => { this.props.closeSimpleAqiGuideNoti() })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment