From 7030399ec8ba47a288bf31ad0610bda8926c3266 Mon Sep 17 00:00:00 2001 From: David Aurelio Date: Mon, 18 Feb 2019 03:03:29 -0800 Subject: [PATCH] Add `YogaNode.create()` Summary: Adds a factory method to `YogaNode`. While this is purely redundant at the moment, it will allow experimentation in follow-up diffs. We will have concrete implementations deriving from `YogaNode` (which will be abstract). Going through `YogaNode.create()` means that we can maintain ABI compatibility. Reviewed By: amir-shalem Differential Revision: D14122974 fbshipit-source-id: 15d92f296d91cc8bbd79a196f370d2dbb69b3f92 --- .../src/main/java/com/facebook/yoga/YogaNode.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.java b/ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.java index a8168cf1f..b50f01d32 100644 --- a/ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.java +++ b/ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.java @@ -795,4 +795,12 @@ public class YogaNode implements Cloneable { newNode.mOwner = this; return newNode.mNativePointer; } + + public static YogaNode create() { + return new YogaNode(); + } + + public static YogaNode create(YogaConfig config) { + return new YogaNode(config); + } }