diff --git a/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfig.java b/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfig.java index 716a212e7..80dfa4313 100644 --- a/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfig.java +++ b/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfig.java @@ -46,4 +46,9 @@ public class YogaConfig { public void setExperimentalFeatureEnabled(YogaExperimentalFeature feature, boolean enabled) { jni_YGConfigSetExperimentalFeatureEnabled(mNativePointer, feature.intValue(), enabled); } + + private native void jni_YGConfigSetUseWebDefaults(long nativePointer, boolean useWebDefaults); + public void setUseWebDefaults(boolean useWebDefaults) { + jni_YGConfigSetUseWebDefaults(mNativePointer, useWebDefaults); + } } diff --git a/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNI.cpp b/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNI.cpp index 72e704c8c..5e3c0b56c 100644 --- a/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNI.cpp +++ b/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNI.cpp @@ -381,6 +381,11 @@ void jni_YGConfigSetExperimentalFeatureEnabled(alias_ref, jlong nativeP YGConfigSetExperimentalFeatureEnabled(config, static_cast(feature), enabled); } +void jni_YGConfigSetUseWebDefaults(alias_ref, jlong nativePointer, jboolean useWebDefaults) { + const YGConfigRef config = _jlong2YGConfigRef(nativePointer); + YGConfigSetUseWebDefaults(config, useWebDefaults); +} + jint jni_YGNodeGetInstanceCount(alias_ref clazz) { return YGNodeGetInstanceCount(); } @@ -476,6 +481,7 @@ jint JNI_OnLoad(JavaVM *vm, void *) { YGMakeNativeMethod(jni_YGConfigNew), YGMakeNativeMethod(jni_YGConfigFree), YGMakeNativeMethod(jni_YGConfigSetExperimentalFeatureEnabled), + YGMakeNativeMethod(jni_YGConfigSetUseWebDefaults), }); }); }