Skip to content

Instantly share code, notes, and snippets.

@shubhnik
Created September 16, 2017 12:22
Show Gist options
  • Save shubhnik/e89d38e424ce5a43849aa2fd0efaee09 to your computer and use it in GitHub Desktop.
Save shubhnik/e89d38e424ce5a43849aa2fd0efaee09 to your computer and use it in GitHub Desktop.
Animations once the image is rendered.
componentDidMount(){
Animated.parallel([
Animated.timing(
this.state.viewOpacity,
{
toValue:1,
duration:100,
useNativeDriver:true
}
),
Animated.timing(
this.state.animateImageY,
{
toValue: height/2 - (this.props.translateY+50),
duration:200,
useNativeDriver:true
}
),
Animated.timing(
this.state.animateImageX,
{
toValue: width/2 - (this.props.translateX+width/4),
duration:200,
useNativeDriver:true
}
),
Animated.timing(
this.state.scaleImageX,
{
toValue: 2,
duration:100,
useNativeDriver:true
}
),
Animated.timing(
this.state.scaleImageY,
{
toValue: (height/3)/100,
duration:100,
useNativeDriver:true
}
)
]).start()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment