本文整理汇总了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);
}
示例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();
}
示例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);
}
}