From a9cf0a4688452a56c79dd364e02ea57c5f9b816c Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Mon, 26 Sep 2016 15:05:16 +0800 Subject: [PATCH 1/2] fixed issue of TouchableBounce not animated on IOS. `useNativeDriver` is not yet supported on IOS now. --- .../Components/Touchable/TouchableBounce.js | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Libraries/Components/Touchable/TouchableBounce.js b/Libraries/Components/Touchable/TouchableBounce.js index bcf6b7c9a74e..57aad47bd210 100644 --- a/Libraries/Components/Touchable/TouchableBounce.js +++ b/Libraries/Components/Touchable/TouchableBounce.js @@ -84,12 +84,20 @@ var TouchableBounce = React.createClass({ bounciness: number, callback?: ?Function ) { - Animated.spring(this.state.scale, { - toValue: value, - velocity, - bounciness, - useNativeDriver: true, - }).start(callback); + if (Platform.OS === 'android') { + Animated.spring(this.state.scale, { + toValue: value, + velocity, + bounciness, + useNativeDriver: true, + }).start(callback); + } else if (Platform.OS === 'ios') { + Animated.spring(this.state.scale, { + toValue: value, + velocity, + bounciness, + }).start(callback); + } }, /** From 9693afdf2d0a77e88d1b495e28fb74c4cc844bf0 Mon Sep 17 00:00:00 2001 From: James Ide Date: Mon, 26 Sep 2016 15:04:59 -0700 Subject: [PATCH 2/2] Update TouchableBounce.js --- .../Components/Touchable/TouchableBounce.js | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/Libraries/Components/Touchable/TouchableBounce.js b/Libraries/Components/Touchable/TouchableBounce.js index 57aad47bd210..ae84e583caf7 100644 --- a/Libraries/Components/Touchable/TouchableBounce.js +++ b/Libraries/Components/Touchable/TouchableBounce.js @@ -84,20 +84,12 @@ var TouchableBounce = React.createClass({ bounciness: number, callback?: ?Function ) { - if (Platform.OS === 'android') { - Animated.spring(this.state.scale, { - toValue: value, - velocity, - bounciness, - useNativeDriver: true, - }).start(callback); - } else if (Platform.OS === 'ios') { - Animated.spring(this.state.scale, { - toValue: value, - velocity, - bounciness, - }).start(callback); - } + Animated.spring(this.state.scale, { + toValue: value, + velocity, + bounciness, + useNativeDriver: Platform.OS === 'android', + }).start(callback); }, /**