mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-11 19:37:57 +08:00
Support for spring animations
Summary: This change adds support for spring animations to be run off the JS thread on android. The implementation is based on the android spring implementation from Rebound (http://facebook.github.io/rebound/) but since only a small subset of the library is used the relevant parts are copied instead of making RN to import the whole library. **Test Plan** Run java tests: `buck test ReactAndroid/src/test/java/com/facebook/react/animated` Add `useNativeDriver: true` to spring animation in animated example app, run it on android Closes https://github.com/facebook/react-native/pull/8860 Differential Revision: D3676436 fbshipit-source-id: 3a4b1b006725a938562712989b93dd4090577c48
This commit is contained in:
committed by
Facebook Github Bot 2
parent
0222107170
commit
8f75d7346f
@@ -135,6 +135,8 @@ import javax.annotation.Nullable;
|
||||
final AnimationDriver animation;
|
||||
if ("frames".equals(type)) {
|
||||
animation = new FrameBasedAnimationDriver(animationConfig);
|
||||
} else if ("spring".equals(type)) {
|
||||
animation = new SpringAnimation(animationConfig);
|
||||
} else {
|
||||
throw new JSApplicationIllegalArgumentException("Unsupported animation type: " + type);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user