From b8f6adf6544be1bbdc56c297a766d75d720adc24 Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Thu, 30 Aug 2018 04:40:48 -0700 Subject: [PATCH] Expose printTree property of YGConfig to jni Summary: Exposes printTree property of YGConfig to jni Reviewed By: IanChilds Differential Revision: D9561097 fbshipit-source-id: 1bf86a63ad5e9baa107e36d429209b9061e6676d --- .../src/main/java/com/facebook/yoga/YogaConfig.java | 5 +++++ .../src/main/jni/first-party/yogajni/jni/YGJNI.cpp | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfig.java b/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfig.java index 128f53285..01dbf70d3 100644 --- a/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfig.java +++ b/ReactAndroid/src/main/java/com/facebook/yoga/YogaConfig.java @@ -54,6 +54,11 @@ public class YogaConfig { jni_YGConfigSetUseWebDefaults(mNativePointer, useWebDefaults); } + private native void jni_YGConfigSetPrintTreeFlag(long nativePointer, boolean enable); + public void setPrintTreeFlag(boolean enable) { + jni_YGConfigSetPrintTreeFlag(mNativePointer, enable); + } + private native void jni_YGConfigSetPointScaleFactor(long nativePointer, float pixelsInPoint); public void setPointScaleFactor(float pixelsInPoint) { jni_YGConfigSetPointScaleFactor(mNativePointer, pixelsInPoint); 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 6233cc231..8234e38d5 100644 --- a/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNI.cpp +++ b/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNI.cpp @@ -598,6 +598,14 @@ void jni_YGConfigSetUseWebDefaults( YGConfigSetUseWebDefaults(config, useWebDefaults); } +void jni_YGConfigSetPrintTreeFlag( + alias_ref, + jlong nativePointer, + jboolean enable) { + const YGConfigRef config = _jlong2YGConfigRef(nativePointer); + YGConfigSetPrintTreeFlag(config, enable); +} + void jni_YGConfigSetPointScaleFactor( alias_ref, jlong nativePointer, @@ -760,6 +768,7 @@ jint JNI_OnLoad(JavaVM* vm, void*) { YGMakeNativeMethod(jni_YGConfigFree), YGMakeNativeMethod(jni_YGConfigSetExperimentalFeatureEnabled), YGMakeNativeMethod(jni_YGConfigSetUseWebDefaults), + YGMakeNativeMethod(jni_YGConfigSetPrintTreeFlag), YGMakeNativeMethod(jni_YGConfigSetPointScaleFactor), YGMakeNativeMethod(jni_YGConfigSetUseLegacyStretchBehaviour), YGMakeNativeMethod(jni_YGConfigSetLogger),