diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java index 0b7b7e1f0..cf3c56455 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/NativeViewHierarchyManager.java @@ -67,10 +67,8 @@ import com.facebook.react.touch.JSResponderHandler; private final JSResponderHandler mJSResponderHandler = new JSResponderHandler(); private final RootViewManager mRootViewManager = new RootViewManager(); - public NativeViewHierarchyManager( - AnimationRegistry animationRegistry, - ViewManagerRegistry viewManagers) { - mAnimationRegistry = animationRegistry; + public NativeViewHierarchyManager(ViewManagerRegistry viewManagers) { + mAnimationRegistry = new AnimationRegistry(); mViewManagers = viewManagers; mTagsToViews = new SparseArray<>(); mTagsToViewManagers = new SparseArray<>(); @@ -78,6 +76,10 @@ import com.facebook.react.touch.JSResponderHandler; mRootViewsContext = new SparseArray<>(); } + public AnimationRegistry getAnimationRegistry() { + return mAnimationRegistry; + } + public void updateProperties(int tag, CatalystStylesDiffMap props) { UiThreadUtil.assertOnUiThread(); diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java index 1512f305f..f8609dc61 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java @@ -22,7 +22,6 @@ import android.util.DisplayMetrics; import com.facebook.csslayout.CSSLayoutContext; import com.facebook.infer.annotation.Assertions; import com.facebook.react.animation.Animation; -import com.facebook.react.animation.AnimationRegistry; import com.facebook.react.bridge.Arguments; import com.facebook.react.bridge.Callback; import com.facebook.react.bridge.LifecycleEventListener; @@ -78,7 +77,6 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements private final NativeViewHierarchyManager mNativeViewHierarchyManager; private final EventDispatcher mEventDispatcher; - private final AnimationRegistry mAnimationRegistry = new AnimationRegistry(); private final ShadowNodeRegistry mShadowNodeRegistry = new ShadowNodeRegistry(); private final ViewManagerRegistry mViewManagers; private final CSSLayoutContext mLayoutContext = new CSSLayoutContext(); @@ -94,13 +92,10 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements super(reactContext); mViewManagers = new ViewManagerRegistry(viewManagerList); mEventDispatcher = new EventDispatcher(reactContext); - mNativeViewHierarchyManager = new NativeViewHierarchyManager( - mAnimationRegistry, - mViewManagers); + mNativeViewHierarchyManager = new NativeViewHierarchyManager(mViewManagers); mOperationsQueue = new UIViewOperationQueue( reactContext, - mNativeViewHierarchyManager, - mAnimationRegistry); + mNativeViewHierarchyManager); mNativeViewHierarchyOptimizer = new NativeViewHierarchyOptimizer( mOperationsQueue, mShadowNodeRegistry); diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java index a931b5e0f..d118561be 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java @@ -456,10 +456,9 @@ public class UIViewOperationQueue { /* package */ UIViewOperationQueue( ReactApplicationContext reactContext, - NativeViewHierarchyManager nativeViewHierarchyManager, - AnimationRegistry animationRegistry) { + NativeViewHierarchyManager nativeViewHierarchyManager) { mNativeViewHierarchyManager = nativeViewHierarchyManager; - mAnimationRegistry = animationRegistry; + mAnimationRegistry = nativeViewHierarchyManager.getAnimationRegistry(); mDispatchUIFrameCallback = new DispatchUIFrameCallback(reactContext); }