Java bindings for setAlwaysFormsContainingBlock (#1540)

Summary:
X-link: https://github.com/facebook/react-native/pull/42192

Pull Request resolved: https://github.com/facebook/yoga/pull/1540

tsia

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D52608259

fbshipit-source-id: 647ec4e2fe180ace8d6b641e17cd610fa53fe845
This commit is contained in:
Joe Vilches
2024-01-08 20:28:49 -08:00
committed by Facebook GitHub Bot
parent 5425107246
commit 47e9f33eb4
4 changed files with 20 additions and 0 deletions

View File

@@ -114,4 +114,5 @@ public class YogaNative {
static native void jni_YGNodePrintJNI(long nativePointer);
static native void jni_YGNodeSetStyleInputsJNI(long nativePointer, float[] styleInputsArray, int size);
static native long jni_YGNodeCloneJNI(long nativePointer);
static native void jni_YGNodeSetAlwaysFormsContainingBlockJNI(long nativePointer, boolean alwaysFormContainingBlock);
}

View File

@@ -226,4 +226,6 @@ public abstract class YogaNode implements YogaProps {
public abstract YogaNode cloneWithoutChildren();
public abstract YogaNode cloneWithChildren();
public abstract void setAlwaysFormsContainingBlock(boolean alwaysFormsContainingBlock);
}

View File

@@ -504,6 +504,11 @@ public abstract class YogaNodeJNIBase extends YogaNode implements Cloneable {
YogaNative.jni_YGNodeSetHasMeasureFuncJNI(mNativePointer, measureFunction != null);
}
@Override
public void setAlwaysFormsContainingBlock(boolean alwaysFormsContainingBlock) {
YogaNative.jni_YGNodeSetAlwaysFormsContainingBlockJNI(mNativePointer, alwaysFormsContainingBlock);
}
// Implementation Note: Why this method needs to stay final
//
// We cache the jmethodid for this method in Yoga code. This means that even if a subclass