Switch to YogaNodeFactory.create
Summary: Switch to `YogaNodeFactory.create()` instead of using `YogaNode.create()` Reviewed By: SidharthGuglani Differential Revision: D17258195 fbshipit-source-id: 5f31540724a16e401fcd0fbdf19a4baa354b2d72
This commit is contained in:
committed by
Facebook Github Bot
parent
6ac38d188c
commit
67a3841164
@@ -17,6 +17,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.facebook.yoga.YogaNode;
|
||||
import com.facebook.yoga.YogaNodeFactory;
|
||||
|
||||
/**
|
||||
* Much like a {@link YogaLayout}, except this class does not render itself (the container) to the
|
||||
@@ -32,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 = YogaNode.create();
|
||||
final private YogaNode mYogaNode = YogaNodeFactory.create();
|
||||
|
||||
public VirtualYogaLayout(Context context) {
|
||||
super(context);
|
||||
@@ -72,7 +73,7 @@ public class VirtualYogaLayout extends ViewGroup {
|
||||
return;
|
||||
}
|
||||
|
||||
YogaNode node = YogaNode.create();
|
||||
YogaNode node = YogaNodeFactory.create();
|
||||
YogaLayout.LayoutParams lp = new YogaLayout.LayoutParams(params);
|
||||
YogaLayout.applyLayoutParams(lp, node, child);
|
||||
node.setData(child);
|
||||
|
@@ -28,6 +28,7 @@ import com.facebook.yoga.YogaMeasureFunction;
|
||||
import com.facebook.yoga.YogaMeasureMode;
|
||||
import com.facebook.yoga.YogaMeasureOutput;
|
||||
import com.facebook.yoga.YogaNode;
|
||||
import com.facebook.yoga.YogaNodeFactory;
|
||||
import com.facebook.yoga.YogaOverflow;
|
||||
import com.facebook.yoga.YogaPositionType;
|
||||
import com.facebook.yoga.YogaWrap;
|
||||
@@ -77,7 +78,7 @@ public class YogaLayout extends ViewGroup {
|
||||
public YogaLayout(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
|
||||
mYogaNode = YogaNode.create();
|
||||
mYogaNode = YogaNodeFactory.create();
|
||||
mYogaNodes = new HashMap<>();
|
||||
|
||||
mYogaNode.setData(this);
|
||||
@@ -154,7 +155,7 @@ public class YogaLayout extends ViewGroup {
|
||||
if(mYogaNodes.containsKey(child)) {
|
||||
childNode = mYogaNodes.get(child);
|
||||
} else {
|
||||
childNode = YogaNode.create();
|
||||
childNode = YogaNodeFactory.create();
|
||||
}
|
||||
|
||||
childNode.setData(child);
|
||||
|
@@ -14,12 +14,12 @@ public class TestParametrization {
|
||||
NodeFactory nodeFactory = new NodeFactory() {
|
||||
@Override
|
||||
public YogaNode create() {
|
||||
return YogaNode.create();
|
||||
return YogaNodeFactory.create();
|
||||
}
|
||||
|
||||
@Override
|
||||
public YogaNode create(YogaConfig config) {
|
||||
return YogaNode.create(config);
|
||||
return YogaNodeFactory.create(config);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user