From f30cc5d9a7d517fb3b4597a77d302d02c86666bb Mon Sep 17 00:00:00 2001 From: Andy Street Date: Thu, 15 Sep 2016 09:15:33 -0700 Subject: [PATCH] Add Dependency Injection, nodes support for RN/Components integration Summary: This should probably be two separate diffs, sorry. It takes forever to test these things on fb4a though. The nodes GK was turned up in fb4a, so I had to make a few changes to make the existing integration work. Reviewed By: lexs, emilsjolander Differential Revision: D3863226 --- .../facebook/react/flat/NativeViewWrapper.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/flat/NativeViewWrapper.java b/ReactAndroid/src/main/java/com/facebook/react/flat/NativeViewWrapper.java index 05b4b8154..3cd0421b0 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/flat/NativeViewWrapper.java +++ b/ReactAndroid/src/main/java/com/facebook/react/flat/NativeViewWrapper.java @@ -16,6 +16,7 @@ import com.facebook.csslayout.CSSNodeAPI; import com.facebook.react.uimanager.ReactStylesDiffMap; import com.facebook.react.uimanager.ReactShadowNode; import com.facebook.react.uimanager.ThemedReactContext; +import com.facebook.react.uimanager.UIViewOperationQueue; import com.facebook.react.uimanager.ViewGroupManager; import com.facebook.react.uimanager.ViewManager; @@ -67,6 +68,14 @@ import com.facebook.react.uimanager.ViewManager; // suppress, this is handled by a ViewManager } + @Override + public void setReactTag(int reactTag) { + super.setReactTag(reactTag); + if (mReactShadowNode != null) { + mReactShadowNode.setReactTag(reactTag); + } + } + @Override public void setThemedContext(ThemedReactContext themedContext) { super.setThemedContext(themedContext); @@ -98,4 +107,12 @@ import com.facebook.react.uimanager.ViewManager; dirty(); } } + + @Override + public void onCollectExtraUpdates(UIViewOperationQueue uiViewOperationQueue) { + if (mReactShadowNode != null && mReactShadowNode.hasUnseenUpdates()) { + mReactShadowNode.onCollectExtraUpdates(uiViewOperationQueue); + markUpdateSeen(); + } + } }