gpt4 book ai didi

com.facebook.yoga.YogaNode.setData()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 07:15:31 29 4
gpt4 key购买 nike

本文整理了Java中com.facebook.yoga.YogaNode.setData()方法的一些代码示例,展示了YogaNode.setData()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YogaNode.setData()方法的具体详情如下:
包路径:com.facebook.yoga.YogaNode
类名称:YogaNode
方法名:setData

YogaNode.setData介绍

暂无

代码示例

代码示例来源:origin: facebook/litho

void init(YogaNode yogaNode, ComponentContext componentContext) {
 if (yogaNode != null) {
  yogaNode.setData(this);
 }
 mYogaNode = yogaNode;
 mComponentContext = componentContext;
 if (mComponentContext.getExtraMemorySize() > 0) {
  mExtraMemory = new int[mComponentContext.getExtraMemorySize()];
 }
}

代码示例来源: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);
}

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com