当前位置: 首页>>代码示例>>Java>>正文


Java ViewGroupManager类代码示例

本文整理汇总了Java中com.facebook.react.uimanager.ViewGroupManager的典型用法代码示例。如果您正苦于以下问题:Java ViewGroupManager类的具体用法?Java ViewGroupManager怎么用?Java ViewGroupManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ViewGroupManager类属于com.facebook.react.uimanager包,在下文中一共展示了ViewGroupManager类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateViewGroup

import com.facebook.react.uimanager.ViewGroupManager; //导入依赖的package包/类
void updateViewGroup(int reactTag, int[] viewsToAdd, int[] viewsToDetach) {
  View view = resolveView(reactTag);
  if (view instanceof FlatViewGroup) {
    ((FlatViewGroup) view).mountViews(this, viewsToAdd, viewsToDetach);
    return;
  }

  ViewGroup viewGroup = (ViewGroup) view;
  ViewGroupManager viewManager = (ViewGroupManager) resolveViewManager(reactTag);
  List<View> listOfViews = new ArrayList<>(viewsToAdd.length);

  // batch the set of additions - some view managers can take advantage of the batching to
  // decrease operations, etc.
  for (int viewIdToAdd : viewsToAdd) {
    int tag = Math.abs(viewIdToAdd);
    listOfViews.add(resolveView(tag));
  }
  viewManager.addViews(viewGroup, listOfViews);
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:20,代码来源:FlatNativeViewHierarchyManager.java

示例2: NativeViewWrapper

import com.facebook.react.uimanager.ViewGroupManager; //导入依赖的package包/类
NativeViewWrapper(ViewManager viewManager) {
  ReactShadowNode reactShadowNode = viewManager.createShadowNodeInstance();
  if (reactShadowNode instanceof YogaMeasureFunction) {
    mReactShadowNode = reactShadowNode;
    setMeasureFunction((YogaMeasureFunction) reactShadowNode);
  } else {
    mReactShadowNode = null;
  }

  if (viewManager instanceof ViewGroupManager) {
    ViewGroupManager viewGroupManager = (ViewGroupManager) viewManager;
    mNeedsCustomLayoutForChildren = viewGroupManager.needsCustomLayoutForChildren();
    mForceMountGrandChildrenToView = viewGroupManager.shouldPromoteGrandchildren();
  } else {
    mNeedsCustomLayoutForChildren = false;
  }

  forceMountToView();
  forceMountChildrenToView();
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:21,代码来源:NativeViewWrapper.java

示例3: detachAllChildrenFromViews

import com.facebook.react.uimanager.ViewGroupManager; //导入依赖的package包/类
void detachAllChildrenFromViews(int[] viewsToDetachAllChildrenFrom) {
  for (int viewTag : viewsToDetachAllChildrenFrom) {
    View view = resolveView(viewTag);
    if (view instanceof FlatViewGroup) {
      ((FlatViewGroup) view).detachAllViewsFromParent();
      continue;
    }

    ViewGroup viewGroup = (ViewGroup) view;
    ViewGroupManager viewManager = (ViewGroupManager) resolveViewManager(viewTag);
    viewManager.removeAllViews(viewGroup);
  }
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:14,代码来源:FlatNativeViewHierarchyManager.java


注:本文中的com.facebook.react.uimanager.ViewGroupManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。