Java Code Examples for com.facebook.react.uimanager.ReactShadowNode#getChildCount()

The following examples show how to use com.facebook.react.uimanager.ReactShadowNode#getChildCount() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ARTSurfaceViewShadowNode.java    From art with MIT License 5 votes vote down vote up
private void markChildrenUpdatesSeen(ReactShadowNode shadowNode) {
  for (int i = 0; i < shadowNode.getChildCount(); i++) {
    ReactShadowNode child = shadowNode.getChildAt(i);
    child.markUpdateSeen();
    markChildrenUpdatesSeen(child);
  }
}
 
Example 2
Source File: ARTSurfaceViewShadowNode.java    From react-native-GPay with MIT License 5 votes vote down vote up
private void markChildrenUpdatesSeen(ReactShadowNode shadowNode) {
  for (int i = 0; i < shadowNode.getChildCount(); i++) {
    ReactShadowNode child = shadowNode.getChildAt(i);
    child.markUpdateSeen();
    markChildrenUpdatesSeen(child);
  }
}
 
Example 3
Source File: FabricUIManager.java    From react-native-GPay with MIT License 5 votes vote down vote up
private void notifyOnBeforeLayoutRecursive(ReactShadowNode node) {
  if (!node.hasUpdates()) {
    return;
  }
  for (int i = 0; i < node.getChildCount(); i++) {
    notifyOnBeforeLayoutRecursive(node.getChildAt(i));
  }
  node.onBeforeLayout();
}
 
Example 4
Source File: FabricUIManager.java    From react-native-GPay with MIT License 5 votes vote down vote up
private void applyUpdatesRecursive(ReactShadowNode node, float absoluteX, float absoluteY) {
  if (!node.hasUpdates()) {
    return;
  }

  if (!node.isVirtualAnchor()) {
    for (int i = 0; i < node.getChildCount(); i++) {
      applyUpdatesRecursive(
          node.getChildAt(i),
          absoluteX + node.getLayoutX(),
          absoluteY + node.getLayoutY());
    }
  }

  int tag = node.getReactTag();
  if (getRootNode(tag) == null) {
    boolean frameDidChange =
        node.dispatchUpdates(absoluteX, absoluteY, mUIViewOperationQueue, null);
    // Notify JS about layout event if requested
    // and if the position or dimensions actually changed
    // (consistent with iOS and Android Default implementation).
    if (frameDidChange && node.shouldNotifyOnLayout()) {
      mUIViewOperationQueue.enqueueOnLayoutEvent(tag,
        node.getScreenX(),
        node.getScreenY(),
        node.getScreenWidth(),
        node.getScreenHeight());
    }
  }

  // Set the reference to the OriginalReactShadowNode to NULL, as the tree is already committed
  // and we do not need to hold references to the previous tree anymore
  node.setOriginalReactShadowNode(null);
  node.markUpdateSeen();
  node.markAsSealed();
}
 
Example 5
Source File: FabricUIManagerTest.java    From react-native-GPay with MIT License 4 votes vote down vote up
private void assertSameChildren(ReactShadowNode node1, ReactShadowNode node2) {
  assertThat(node1.getChildCount()).isEqualTo(node2.getChildCount());
  for (int i = 0; i < node1.getChildCount(); i++) {
    assertThat(node1.getChildAt(i)).isEqualTo(node2.getChildAt(i));
  }
}