I need to make an animation, which will make image smaller, then will make image a little bit bigger and then back to normal, this animation should repeat every time, when user is pressing on the button.
Here is what I already have, currently it makes image just smaller. How to make it bigger after that and then to normal size again?
class ReflectionScreen extends React.Component {
constructor(props) {
super(props)
this.animatedValue = new Animated.Value(0)
}
handleAnimation = () => {
Animated.timing(this.animatedValue, {
toValue: 1,
duration: 1000,
easing: Easing.ease
}).start()
}
render() {
<TouchableOpacity style={styles.handContainer} onPress={this.goIncrement}>
<Animated.Image
source={require('../images/tapHand.png')}
style={
[styles.imageHand,
{transform: [
{
translateX: this.animatedValue.interpolate({
inputRange: [0, 1],
outputRange: [0, 0.7]
})
},
{
translateY: this.animatedValue.interpolate({
inputRange: [0, 1],
outputRange: [0, 0.7]
})
},
{
scaleX: this.animatedValue.interpolate({
inputRange: [0, 1],
outputRange: [1, 0.7]
})
},
{
scaleY: this.animatedValue.interpolate({
inputRange: [0, 1],
outputRange: [1, 0.7]
})
},
{perspective: 1000}
]
}
]}
/>
</TouchableOpacity>
}
)}
}