Expose native pointer thru an interface function for YogaConfig

Summary:
Expose native pointer thru an interface function for YogaConfig (its package private to `com.facebook.yoga` namespace),
This way we can make later on YogaConfig a pure abstract class.

Plus, it makes sure external users don't modify the pointer

Reviewed By: SidharthGuglani

Differential Revision: D17266401

fbshipit-source-id: f39b488cea0b73bc3578bb3aa90ab00139bf9271
This commit is contained in:
Amir Shalem
2019-09-17 06:52:49 -07:00
committed by Facebook Github Bot
parent d697bbe0a5
commit 499d28d021
2 changed files with 6 additions and 2 deletions

View File

@@ -12,7 +12,7 @@ public class YogaConfig {
public static int SPACING_TYPE = 1;
long mNativePointer;
private long mNativePointer;
private YogaLogger mLogger;
private YogaNodeCloneFunction mYogaNodeCloneFunction;
@@ -76,4 +76,8 @@ public class YogaConfig {
public YogaLogger getLogger() {
return mLogger;
}
long getNativePointer() {
return mNativePointer;
}
}

View File

@@ -58,7 +58,7 @@ public abstract class YogaNodeJNIBase extends YogaNode implements Cloneable {
}
YogaNodeJNIBase(YogaConfig config) {
this(YogaNative.jni_YGNodeNewWithConfig(config.mNativePointer));
this(YogaNative.jni_YGNodeNewWithConfig(config.getNativePointer()));
}
public void reset() {