Harmonize native animation callback args with JS

Summary:
`Animated.parallel` among other functions expects the `start(callback)` function to be invoked with an `endState` object. Currently natively driven animations call the handler with `null`, this PR changes that to `{ finished: true }`.

**Test plan**

This should not throw any errors:
```js
Animated.parallel([
  Animated.timing(
    new Animated.Value(0),
    {
      toValue: 1,
      useNativeDriver: true
    }
  ),
  Animated.timing(
    new Animated.Value(0),
    {
      toValue: 1,
      useNativeDriver: true
    }
  )
]).start();
```
Closes https://github.com/facebook/react-native/pull/8567

Differential Revision: D3517291

Pulled By: javache

fbshipit-source-id: 0056a5b4261546b061451c0b1b249718739086bc
This commit is contained in:
Joel Arvidsson 2016-07-05 10:58:17 -07:00 committed by Facebook Github Bot 2
parent 0d58314fa6
commit cc816fbd82

View File

@ -68,7 +68,9 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
[self stopAnimation];
_valueNode = nil;
if (_callback) {
_callback(@[(id)kCFNull]);
_callback(@[@{
@"finished": @(_animationHasFinished)
}]);
}
}