Switch to YogaNode.create()
Summary: @public Switches instance creation from `new YogaNode()` to `YogaNode.create()`. This allows for experimentation with different implementations, while maintaining API + ABI compatibility internally at FB, as well as for dependent projects in open source and elsewhere. Reviewed By: amir-shalem Differential Revision: D14122975 fbshipit-source-id: f194b146b7cd693dba1a7dafdf92d350e54cb179
This commit is contained in:
committed by
Facebook Github Bot
parent
cbcf07f08a
commit
016a10df26
@@ -33,7 +33,7 @@ public class VirtualYogaLayout extends ViewGroup {
|
||||
|
||||
final private List<View> mChildren = new LinkedList<>();
|
||||
final private Map<View, YogaNode> mYogaNodes = new HashMap<>();
|
||||
final private YogaNode mYogaNode = new YogaNode();
|
||||
final private YogaNode mYogaNode = YogaNode.create();
|
||||
|
||||
public VirtualYogaLayout(Context context) {
|
||||
super(context);
|
||||
@@ -73,7 +73,7 @@ public class VirtualYogaLayout extends ViewGroup {
|
||||
return;
|
||||
}
|
||||
|
||||
YogaNode node = new YogaNode();
|
||||
YogaNode node = YogaNode.create();
|
||||
YogaLayout.LayoutParams lp = new YogaLayout.LayoutParams(params);
|
||||
YogaLayout.applyLayoutParams(lp, node, child);
|
||||
node.setData(child);
|
||||
|
@@ -78,7 +78,7 @@ public class YogaLayout extends ViewGroup {
|
||||
public YogaLayout(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
|
||||
mYogaNode = new YogaNode();
|
||||
mYogaNode = YogaNode.create();
|
||||
mYogaNodes = new HashMap<>();
|
||||
|
||||
mYogaNode.setData(this);
|
||||
@@ -155,7 +155,7 @@ public class YogaLayout extends ViewGroup {
|
||||
if(mYogaNodes.containsKey(child)) {
|
||||
childNode = mYogaNodes.get(child);
|
||||
} else {
|
||||
childNode = new YogaNode();
|
||||
childNode = YogaNode.create();
|
||||
}
|
||||
|
||||
childNode.setData(child);
|
||||
|
@@ -15,12 +15,12 @@ public class TestParametrization {
|
||||
NodeFactory nodeFactory = new NodeFactory() {
|
||||
@Override
|
||||
public YogaNode create() {
|
||||
return new YogaNode();
|
||||
return YogaNode.create();
|
||||
}
|
||||
|
||||
@Override
|
||||
public YogaNode create(YogaConfig config) {
|
||||
return new YogaNode(config);
|
||||
return YogaNode.create(config);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user