Skip to content

Commit

Permalink
Expose printTree property of YGConfig to jni
Browse files Browse the repository at this point in the history
Summary: Exposes printTree property of YGConfig to jni

Reviewed By: IanChilds

Differential Revision: D9561097

fbshipit-source-id: 1bf86a63ad5e9baa107e36d429209b9061e6676d
  • Loading branch information
priteshrnandgaonkar authored and empyrical committed Aug 30, 2018
1 parent 506994d commit 3a3bda4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ReactAndroid/src/main/java/com/facebook/yoga/YogaConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public void setUseWebDefaults(boolean useWebDefaults) {
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);
Expand Down
9 changes: 9 additions & 0 deletions ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,14 @@ void jni_YGConfigSetUseWebDefaults(
YGConfigSetUseWebDefaults(config, useWebDefaults);
}

void jni_YGConfigSetPrintTreeFlag(
alias_ref<jobject>,
jlong nativePointer,
jboolean enable) {
const YGConfigRef config = _jlong2YGConfigRef(nativePointer);
YGConfigSetPrintTreeFlag(config, enable);
}

void jni_YGConfigSetPointScaleFactor(
alias_ref<jobject>,
jlong nativePointer,
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 3a3bda4

Please sign in to comment.