Remove AnimationRegistry from UIManageModule
Summary: public UIManageModule creates AnimationRegistry but never uses it, this diff moves it to NativeViewHierarchyManager who owns it. UIViewOperationQueue depends on AnimationRegistry to perform some of the enqueued operations, so it accessed it through a getting in NativeViewHierarchyManager. This will also make sure NativeViewHierarchyManager. and UIViewOperationQueue operate on the same AnimationManager (previously, that wasn't really enforced). This is needed so I can move away UIViewOperationQueue creation off the UIManagerModule. This diff should have no functional changes whatsoever. Reviewed By: astreet Differential Revision: D2462605 fb-gh-sync-id: 1e3cd64908f51126362f2b5fb39b1efa6521854e
This commit is contained in:
parent
0e11379dbb
commit
16350ae09b
|
@ -67,10 +67,8 @@ import com.facebook.react.touch.JSResponderHandler;
|
||||||
private final JSResponderHandler mJSResponderHandler = new JSResponderHandler();
|
private final JSResponderHandler mJSResponderHandler = new JSResponderHandler();
|
||||||
private final RootViewManager mRootViewManager = new RootViewManager();
|
private final RootViewManager mRootViewManager = new RootViewManager();
|
||||||
|
|
||||||
public NativeViewHierarchyManager(
|
public NativeViewHierarchyManager(ViewManagerRegistry viewManagers) {
|
||||||
AnimationRegistry animationRegistry,
|
mAnimationRegistry = new AnimationRegistry();
|
||||||
ViewManagerRegistry viewManagers) {
|
|
||||||
mAnimationRegistry = animationRegistry;
|
|
||||||
mViewManagers = viewManagers;
|
mViewManagers = viewManagers;
|
||||||
mTagsToViews = new SparseArray<>();
|
mTagsToViews = new SparseArray<>();
|
||||||
mTagsToViewManagers = new SparseArray<>();
|
mTagsToViewManagers = new SparseArray<>();
|
||||||
|
@ -78,6 +76,10 @@ import com.facebook.react.touch.JSResponderHandler;
|
||||||
mRootViewsContext = new SparseArray<>();
|
mRootViewsContext = new SparseArray<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AnimationRegistry getAnimationRegistry() {
|
||||||
|
return mAnimationRegistry;
|
||||||
|
}
|
||||||
|
|
||||||
public void updateProperties(int tag, CatalystStylesDiffMap props) {
|
public void updateProperties(int tag, CatalystStylesDiffMap props) {
|
||||||
UiThreadUtil.assertOnUiThread();
|
UiThreadUtil.assertOnUiThread();
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@ import android.util.DisplayMetrics;
|
||||||
import com.facebook.csslayout.CSSLayoutContext;
|
import com.facebook.csslayout.CSSLayoutContext;
|
||||||
import com.facebook.infer.annotation.Assertions;
|
import com.facebook.infer.annotation.Assertions;
|
||||||
import com.facebook.react.animation.Animation;
|
import com.facebook.react.animation.Animation;
|
||||||
import com.facebook.react.animation.AnimationRegistry;
|
|
||||||
import com.facebook.react.bridge.Arguments;
|
import com.facebook.react.bridge.Arguments;
|
||||||
import com.facebook.react.bridge.Callback;
|
import com.facebook.react.bridge.Callback;
|
||||||
import com.facebook.react.bridge.LifecycleEventListener;
|
import com.facebook.react.bridge.LifecycleEventListener;
|
||||||
|
@ -78,7 +77,6 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
|
||||||
|
|
||||||
private final NativeViewHierarchyManager mNativeViewHierarchyManager;
|
private final NativeViewHierarchyManager mNativeViewHierarchyManager;
|
||||||
private final EventDispatcher mEventDispatcher;
|
private final EventDispatcher mEventDispatcher;
|
||||||
private final AnimationRegistry mAnimationRegistry = new AnimationRegistry();
|
|
||||||
private final ShadowNodeRegistry mShadowNodeRegistry = new ShadowNodeRegistry();
|
private final ShadowNodeRegistry mShadowNodeRegistry = new ShadowNodeRegistry();
|
||||||
private final ViewManagerRegistry mViewManagers;
|
private final ViewManagerRegistry mViewManagers;
|
||||||
private final CSSLayoutContext mLayoutContext = new CSSLayoutContext();
|
private final CSSLayoutContext mLayoutContext = new CSSLayoutContext();
|
||||||
|
@ -94,13 +92,10 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
|
||||||
super(reactContext);
|
super(reactContext);
|
||||||
mViewManagers = new ViewManagerRegistry(viewManagerList);
|
mViewManagers = new ViewManagerRegistry(viewManagerList);
|
||||||
mEventDispatcher = new EventDispatcher(reactContext);
|
mEventDispatcher = new EventDispatcher(reactContext);
|
||||||
mNativeViewHierarchyManager = new NativeViewHierarchyManager(
|
mNativeViewHierarchyManager = new NativeViewHierarchyManager(mViewManagers);
|
||||||
mAnimationRegistry,
|
|
||||||
mViewManagers);
|
|
||||||
mOperationsQueue = new UIViewOperationQueue(
|
mOperationsQueue = new UIViewOperationQueue(
|
||||||
reactContext,
|
reactContext,
|
||||||
mNativeViewHierarchyManager,
|
mNativeViewHierarchyManager);
|
||||||
mAnimationRegistry);
|
|
||||||
mNativeViewHierarchyOptimizer = new NativeViewHierarchyOptimizer(
|
mNativeViewHierarchyOptimizer = new NativeViewHierarchyOptimizer(
|
||||||
mOperationsQueue,
|
mOperationsQueue,
|
||||||
mShadowNodeRegistry);
|
mShadowNodeRegistry);
|
||||||
|
|
|
@ -456,10 +456,9 @@ public class UIViewOperationQueue {
|
||||||
|
|
||||||
/* package */ UIViewOperationQueue(
|
/* package */ UIViewOperationQueue(
|
||||||
ReactApplicationContext reactContext,
|
ReactApplicationContext reactContext,
|
||||||
NativeViewHierarchyManager nativeViewHierarchyManager,
|
NativeViewHierarchyManager nativeViewHierarchyManager) {
|
||||||
AnimationRegistry animationRegistry) {
|
|
||||||
mNativeViewHierarchyManager = nativeViewHierarchyManager;
|
mNativeViewHierarchyManager = nativeViewHierarchyManager;
|
||||||
mAnimationRegistry = animationRegistry;
|
mAnimationRegistry = nativeViewHierarchyManager.getAnimationRegistry();
|
||||||
mDispatchUIFrameCallback = new DispatchUIFrameCallback(reactContext);
|
mDispatchUIFrameCallback = new DispatchUIFrameCallback(reactContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue