Add support for clamping for NativeAnimated on iOS

Summary:
This diff adds support for clamping on iOS. It separates out code originally submitted in #9048.

Test plan (required)

Run UIExplorer NativeAnimated examples before and after - compare the results. Pay special attention to the new clamped spring example.
Closes https://github.com/facebook/react-native/pull/9625

Differential Revision: D4053231

fbshipit-source-id: 29048de444ff5f6d7fe7dce7897399b483ee6d2d
This commit is contained in:
Ryan Gomba
2016-10-20 14:12:37 -07:00
committed by Facebook Github Bot
parent 518915a750
commit 5794ff61bc
5 changed files with 70 additions and 21 deletions

View File

@@ -320,7 +320,7 @@ exports.examples = [
},
},
{
title: 'Scale interpolation',
title: 'Scale interpolation with clamping',
description: 'description',
render: function() {
return (
@@ -335,8 +335,9 @@ exports.examples = [
transform: [
{
scale: anim.interpolate({
inputRange: [0, 1],
inputRange: [0, 0.5],
outputRange: [1, 1.4],
extrapolateRight: 'clamp',
})
}
],