react-native/RNTester/RNTesterUnitTests
Krzysztof Magiera b48f7e5605 Support for animated tracking in native driver
Summary:
This PR adds support for Animated tracking to Animated Native Driver implementation on Android and iOS.

Animated tracking allows for animation to be started with a "dynamic" end value. Instead of passing a fixed number as end value we can pass a reference to another Animated.Value. Then when that value changes, the animation will be reconfigured to drive the animation to the new destination point. What is important is that animation will keep its state in the process of updating "toValue". That is if it is a spring animation and the end value changes while the previous animation still hasn't settled the new animation will start from the current position and will inherit current velocity. This makes end value transitions very smooth.

Animated tracking is available in JS implementation of Animated library but not in the native implementation. Therefore until now, it wasn't possible to utilize native driver when using animated tracking. Offloading animation from JS thread turns out to be crucial for gesture driven animations. This PR is a step forward towards feature parity between JS and native implementations of Animated.

Here is a link to example video that shows how tracking can be used to implement chat heads effect: https://twitter.com/kzzzf/status/958362032650244101

In addition this PR fixes an issue with frames animation driver on Android that because of rounding issues was taking one extra frame to start. Because of that change I had to update a number of Android unit tests that were relying on that behavior and running that one additional animation step prior to performing checks.

As a part of this PR I'm adding three unit tests for each of the platforms that verifies most important aspects of this implementation. Please refer to the code and look at the test cases top level comments to learn what they do.

I'm also adding a section to "Native Animated Example" screen in RNTester app that provides a test case for tracking. In the example we have blue square that fallows the red line drawn on screen. Line uses Animated.Value for it's position while square is connected via tracking spring animation to that value. So it is ought to follow the line. When user taps in the area surrounding the button new position for the red line is selected at random and the value updates. Then we can watch blue screen animate to that position.

You can also refer to this video that I use to demonstrate how tracking can be linked with native gesture events using react-native-gesture-handler lib: https://twitter.com/kzzzf/status/958362032650244101

[GENERAL][FEATURE][Native Animated] - Added support for animated tracking to native driver. Now you can use `useNativeDriver` flag with animations that track other Animated.Values
Closes https://github.com/facebook/react-native/pull/17896

Differential Revision: D6974170

Pulled By: hramos

fbshipit-source-id: 50e918b36ee10f80c1deb866c955661d4cc2619b
2018-02-16 12:10:01 -08:00
..
OCMock Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
Info.plist Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
RCTAllocationTests.m Delete RCTBatchedBridge 2018-02-05 12:02:35 -08:00
RCTAnimationUtilsTests.m Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
RCTBlobManagerTests.m Implement Blob support for XMLHttpRequest 2018-01-26 09:17:11 -08:00
RCTBundleURLProviderTests.m Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
RCTComponentPropsTests.m RCTShadowView have got `rootView` property 2017-08-24 00:05:48 -07:00
RCTConvert_NSURLTests.m Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
RCTConvert_YGValueTests.m Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
RCTDevMenuTests.m Make RCTSamplingProfilerPackagerMethod not depend on RCTBridge 2017-06-15 12:07:34 -07:00
RCTEventDispatcherTests.m More attempts to fix Travis CI runs 2017-05-10 04:32:54 -07:00
RCTFontTests.m Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
RCTGzipTests.m Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
RCTImageLoaderHelpers.h Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
RCTImageLoaderHelpers.m Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
RCTImageLoaderTests.m Correct logo URL 2017-12-07 08:31:38 -08:00
RCTImageUtilTests.m Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
RCTJSONTests.m Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
RCTMethodArgumentTests.m Return NSString instead of SEL 2017-11-03 16:31:31 -07:00
RCTModuleInitNotificationRaceTests.m Configure requiresMainQueueSetup for core modules 2017-08-07 07:04:36 -07:00
RCTModuleInitTests.m Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
RCTModuleMethodTests.mm Fix missing files in OSS build 2017-07-26 05:47:22 -07:00
RCTMultipartStreamReaderTests.m Show bundle download progress on iOS 2017-08-14 11:05:35 -07:00
RCTNativeAnimatedNodesManagerTests.m Support for animated tracking in native driver 2018-02-16 12:10:01 -08:00
RCTShadowViewTests.m Reimagining of RCTShadowView layout API 2018-02-12 00:32:43 -08:00
RCTUIManagerTests.m Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
RCTURLUtilsTests.m Add RCTLibraryPathForURL in RCTUtil 2017-12-14 14:31:50 -08:00
RCTUnicodeDecodeTests.m Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
RNTesterUnitTestsBundle.js Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00
libOCMock.a Re-license and rename UIExplorer integration test app as RNTester 2017-05-08 11:31:19 -07:00