Move execution of Yoga.calculateLayout method before diffing algorithm

Reviewed By: shergin

Differential Revision: D7495581

fbshipit-source-id: 63d2f2a66c53727dea7981837d6d0f896bac35d3
This commit is contained in:
David Vacca 2018-04-06 15:01:15 -07:00 committed by Facebook Github Bot
parent e21bbee586
commit 84ae1c9aec
1 changed files with 16 additions and 9 deletions

View File

@ -256,20 +256,12 @@ public class FabricUIManager implements UIManager {
currentRootShadowNode, currentRootShadowNode,
"Root view with tag " + rootTag + " must be added before completeRoot is called"); "Root view with tag " + rootTag + " must be added before completeRoot is called");
currentRootShadowNode = calculateDiffingAndCreateNewRootNode(currentRootShadowNode, childList); currentRootShadowNode = calculateDiffingAndCreateNewRootNode(currentRootShadowNode, childList);
if (DEBUG) {
Log.d(TAG, "ReactShadowNodeHierarchy after diffing: " + currentRootShadowNode.getHierarchyInfo());
}
notifyOnBeforeLayoutRecursive(currentRootShadowNode);
currentRootShadowNode.calculateLayout();
if (DEBUG) { if (DEBUG) {
Log.d( Log.d(
TAG, TAG,
"ReactShadowNodeHierarchy after calculate Layout: " + currentRootShadowNode.getHierarchyInfo()); "ReactShadowNodeHierarchy after diffing: " + currentRootShadowNode.getHierarchyInfo());
} }
applyUpdatesRecursive(currentRootShadowNode, 0, 0); applyUpdatesRecursive(currentRootShadowNode, 0, 0);
@ -299,6 +291,21 @@ public class FabricUIManager implements UIManager {
appendChild(newRootShadowNode, child); appendChild(newRootShadowNode, child);
} }
if (DEBUG) {
Log.d(
TAG,
"ReactShadowNodeHierarchy before calculateLayout: " + newRootShadowNode.getHierarchyInfo());
}
notifyOnBeforeLayoutRecursive(newRootShadowNode);
newRootShadowNode.calculateLayout();
if (DEBUG) {
Log.d(
TAG,
"ReactShadowNodeHierarchy after calculateLayout: " + newRootShadowNode.getHierarchyInfo());
}
mFabricReconciler.manageChildren(currentRootShadowNode, newRootShadowNode); mFabricReconciler.manageChildren(currentRootShadowNode, newRootShadowNode);
return newRootShadowNode; return newRootShadowNode;
} }