Fix commit order of operations in Nodes
Summary: Split dispatchViewUpdates into two methods, which enables subclasses to commit pending ui operations, even when no root node is present. Differential Revision: D3011191 fb-gh-sync-id: a3491179441223aeffe21ff483dda582053768e7 shipit-source-id: a3491179441223aeffe21ff483dda582053768e7
This commit is contained in:
parent
71e59761c9
commit
21b7bf4728
|
@ -446,6 +446,12 @@ public class UIImplementation {
|
|||
* Invoked at the end of the transaction to commit any updates to the node hierarchy.
|
||||
*/
|
||||
public void dispatchViewUpdates(EventDispatcher eventDispatcher, int batchId) {
|
||||
updateViewHierarchy(eventDispatcher);
|
||||
mNativeViewHierarchyOptimizer.onBatchComplete();
|
||||
mOperationsQueue.dispatchViewUpdates(batchId);
|
||||
}
|
||||
|
||||
protected void updateViewHierarchy(EventDispatcher eventDispatcher) {
|
||||
for (int i = 0; i < mShadowNodeRegistry.getRootNodeCount(); i++) {
|
||||
int tag = mShadowNodeRegistry.getRootTag(i);
|
||||
ReactShadowNode cssRoot = mShadowNodeRegistry.getNode(tag);
|
||||
|
@ -454,9 +460,6 @@ public class UIImplementation {
|
|||
calculateRootLayout(cssRoot);
|
||||
applyUpdatesRecursive(cssRoot, 0f, 0f, eventDispatcher);
|
||||
}
|
||||
|
||||
mNativeViewHierarchyOptimizer.onBatchComplete();
|
||||
mOperationsQueue.dispatchViewUpdates(batchId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue