com.facebook.react.uimanager.ReactShadowNode#getChildCount ( )源码实例Demo

下面列出了com.facebook.react.uimanager.ReactShadowNode#getChildCount ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: art   文件: ARTSurfaceViewShadowNode.java
private void markChildrenUpdatesSeen(ReactShadowNode shadowNode) {
  for (int i = 0; i < shadowNode.getChildCount(); i++) {
    ReactShadowNode child = shadowNode.getChildAt(i);
    child.markUpdateSeen();
    markChildrenUpdatesSeen(child);
  }
}
 
private void markChildrenUpdatesSeen(ReactShadowNode shadowNode) {
  for (int i = 0; i < shadowNode.getChildCount(); i++) {
    ReactShadowNode child = shadowNode.getChildAt(i);
    child.markUpdateSeen();
    markChildrenUpdatesSeen(child);
  }
}
 
源代码3 项目: react-native-GPay   文件: FabricUIManager.java
private void notifyOnBeforeLayoutRecursive(ReactShadowNode node) {
  if (!node.hasUpdates()) {
    return;
  }
  for (int i = 0; i < node.getChildCount(); i++) {
    notifyOnBeforeLayoutRecursive(node.getChildAt(i));
  }
  node.onBeforeLayout();
}
 
源代码4 项目: react-native-GPay   文件: FabricUIManager.java
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();
}
 
源代码5 项目: react-native-GPay   文件: FabricUIManagerTest.java
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));
  }
}