mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-30 17:33:21 +08:00
fix method overriding when using native animations
Reviewed By: davidaurelio Differential Revision: D3683921 fbshipit-source-id: 8be9437c1f2625c69d0e07142010494a01f52005
This commit is contained in:
committed by
Facebook Github Bot 8
parent
335132ad63
commit
b7903e4f96
@@ -97,7 +97,7 @@ class Animation {
|
||||
NativeAnimatedAPI.stopAnimation(this.__nativeId);
|
||||
}
|
||||
}
|
||||
_getNativeAnimationConfig(): any {
|
||||
__getNativeAnimationConfig(): any {
|
||||
// Subclasses that have corresponding animation implementation done in native
|
||||
// should override this method
|
||||
throw new Error('This animation type cannot be offloaded to native');
|
||||
@@ -114,7 +114,7 @@ class Animation {
|
||||
NativeAnimatedAPI.startAnimatingNode(
|
||||
this.__nativeId,
|
||||
animatedValue.__getNativeTag(),
|
||||
this._getNativeAnimationConfig(),
|
||||
this.__getNativeAnimationConfig(),
|
||||
this.__debouncedOnEnd.bind(this)
|
||||
);
|
||||
}
|
||||
@@ -253,7 +253,7 @@ class TimingAnimation extends Animation {
|
||||
this._useNativeDriver = config.useNativeDriver !== undefined ? config.useNativeDriver : false;
|
||||
}
|
||||
|
||||
_getNativeAnimationConfig(): any {
|
||||
__getNativeAnimationConfig(): any {
|
||||
var frameDuration = 1000.0 / 60.0;
|
||||
var frames = [];
|
||||
for (var dt = 0.0; dt < this._duration; dt += frameDuration) {
|
||||
@@ -485,7 +485,7 @@ class SpringAnimation extends Animation {
|
||||
this._friction = springConfig.friction;
|
||||
}
|
||||
|
||||
_getNativeAnimationConfig() {
|
||||
__getNativeAnimationConfig() {
|
||||
return {
|
||||
type: 'spring',
|
||||
overshootClamping: this._overshootClamping,
|
||||
|
||||
Reference in New Issue
Block a user