Summary:
We already reimplement the spring computation, we were only using rebound for the tension/friction conversion. Turns out that it is quite small so we can just embed it. I'm doing this as I'm preparing for doing a web version of the feature and I'm trying to minimize the number of dependencies.
https://github.com/facebook/rebound-js/blob/master/rebound.js#L932
Summary:
Animated.spring is not guarantee to stabilize at exactly toValue (determined by restDisplacementThreshold). It is a bit annoying that the last value is not toValue, it makes the logs harder to read and also prevents you from writing code like value === toValue. Instead you need to track it down somewhere else.
Summary:
This is most of the infra necessary for the gratuitous animation demo app.
I originally had things more split up, but it was just confusing because everything is so interlinked and dependent, so lower diffs would have code that wasn't even going to survive (and thus not useful to review), so I merged it all here.
- `Animated.event` now supports mapping to multiple arguments (needed for `onPanResponderMove` events which provide the `gestureState` as the second arg.
- Vectors: new `Animated.ValueXY` class which composes two `Animated.Value`s for convenience/brevity
- Listeners: values and events can be listened to in order to trigger state updates based on their values. Intended to work as async updates from native that might lag behind truth.
- Offsets: a common pattern with pan and other gestures is to track where you left off. This is easily encoded in the Value directly with `setOffset(offset)`, typically used on grant, and can be flattened back into the base value and reset with `flattenOffset()`, typically called on release.
- Tracking: supports `Animated.Value/ValueXY` for `toValue` with all animations, enabling linking multiple values together with some curve or physics. `Animated.timing` can be used with `duration: 0` to rigidly link the values with no lag, or `Animated.spring` can be used to link them like chat heads.
- `Animated.Image` as a default export.
- Various cleanup, bug, flow and lint fixes.
Summary:
Having bugs in Groups because POPAnimation experiences a race condition. This hack avoids that for now while we transition away from POPAnimation altogether.
Summary:
@public
Less verbose - now can just do `LayoutAnimation.easeInEaseOut()` instead of
`LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)`
Test Plan: D2171336, play with AdsManager pickers.
Summary:
This adds the Keyboard animation type for when you want to animate UI based on the keyboard appearing/disappearing.
Closes https://github.com/facebook/react-native/pull/1366
Github Author: Stanislav Vishnevskiy <vishnevskiy@gmail.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
Now `RCTAnimationExperimentalManager` is not working on 32bit devices.
```
NSValue *fromValue = [view.layer.presentationLayer valueForKeyPath:keypath];
CGFloat fromFields[count];
[fromValue getValue:fromFields];
```
If the fromValue is kind of double value which needs two bytes in 32bit device and the count is 1, the fromFileds array will go wrong.
Closes https://github.com/facebook/react-native/pull/1725
Github Author: =?UTF-8?q?=E9=9A=90=E9=A3=8E?= <yinfeng.fcx@alibaba-inc.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
[CATransaction Class Reference](https://developer.apple.com/library/mac/documentation/GraphicsImaging/Reference/CATransaction_class/index.html)
In Tasks > Getting and Setting Completion Block Objects > Discussion:
The completion block object that is guaranteed to be called (on the main thread) as soon as all animations subsequently added by this transaction group have completed (or have been removed.) If no animations are added before the current transaction group is committed (or the completion block is set to a different value,) the block will be invoked immediately.
Closes https://github.com/facebook/react-native/pull/1400
Github Author: Shuangzuan <shuangzuan.he@icloud.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.
Summary:
Simple linear easing also very useful.
Closes https://github.com/facebook/react-native/pull/794
Github Author: Ivan Starkov <istarkov@gmail.com>
Test Plan: Imported from GitHub, without a `Test Plan:` line.