本文整理了Java中com.facebook.yoga.YogaNode.<init>()
方法的一些代码示例,展示了YogaNode.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YogaNode.<init>()
方法的具体详情如下:
包路径:com.facebook.yoga.YogaNode
类名称:YogaNode
方法名:<init>
暂无
代码示例来源:origin: facebook/litho
static YogaNode acquireYogaNode() {
initYogaConfigIfNecessary();
YogaNode node = ComponentsConfiguration.disablePools ? null : sYogaNodePool.acquire();
if (node == null) {
node =
PoolsConfig.sYogaNodeFactory != null
? PoolsConfig.sYogaNodeFactory.create(sYogaConfig)
: new YogaNode(sYogaConfig);
}
return node;
}
代码示例来源:origin: facebook/litho
@Before
public void setUp() {
mDiffNode = mock(DiffNode.class);
mNode = mock(InternalNode.class);
final YogaNode cssNode = new YogaNode();
cssNode.setData(mNode);
mNode.mYogaNode = cssNode;
mockStatic(ComponentsPools.class);
when(mNode.getLastWidthSpec()).thenReturn(-1);
when(mNode.getDiffNode()).thenReturn(mDiffNode);
when(mDiffNode.getLastMeasuredWidth()).thenReturn(-1f);
when(mDiffNode.getLastMeasuredHeight()).thenReturn(-1f);
when(ComponentsPools.acquireInternalNode(any(ComponentContext.class))).thenReturn(mNode);
when(ComponentsPools.acquireComponentTreeBuilder(
any(ComponentContext.class), any(Component.class)))
.thenCallRealMethod();
mockStatic(LayoutState.class);
StateHandler stateHandler = mock(StateHandler.class);
mContext = spy(new ComponentContext(RuntimeEnvironment.application, stateHandler));
mNestedTreeWidthSpec = SizeSpec.makeSizeSpec(400, SizeSpec.EXACTLY);
mNestedTreeHeightSpec = SizeSpec.makeSizeSpec(200, SizeSpec.EXACTLY);
}
代码示例来源:origin: koudle/AndYogaSample
YogaNode root = new YogaNode();
root.setWidth(500);
root.setHeight(300);
root.setPadding(YogaEdge.ALL, 20);
YogaNode text = new YogaNode();
text.setWidth(200);
text.setHeight(25);
YogaNode image = new YogaNode();
image.setWidth(50);
image.setHeight(50);
内容来源于网络,如有侵权,请联系作者删除!