Set layout outputs on java object from C

Reviewed By: lexs

Differential Revision: D4077968

fbshipit-source-id: bce86ba610cd5ae36cfb45d78b2609c63a14cfa3
This commit is contained in:
Emil Sjolander 2016-10-27 10:52:12 -07:00 committed by Facebook Github Bot
parent 8e69a9f695
commit 844cafd883
1 changed files with 26 additions and 14 deletions

View File

@ -45,6 +45,17 @@ public class CSSNode implements CSSNodeAPI<CSSNode> {
private boolean mHasSetBorder = false;
private boolean mHasSetPosition = false;
@DoNotStrip
private float mWidth = CSSConstants.UNDEFINED;
@DoNotStrip
private float mHeight = CSSConstants.UNDEFINED;
@DoNotStrip
private float mTop = CSSConstants.UNDEFINED;
@DoNotStrip
private float mLeft = CSSConstants.UNDEFINED;
@DoNotStrip
private int mLayoutDirection = 0;
private native long jni_CSSNodeNew();
public CSSNode() {
mNativePointer = jni_CSSNodeNew();
@ -73,6 +84,12 @@ public class CSSNode implements CSSNodeAPI<CSSNode> {
mHasSetBorder = false;
mHasSetPosition = false;
mWidth = CSSConstants.UNDEFINED;
mHeight = CSSConstants.UNDEFINED;
mTop = CSSConstants.UNDEFINED;
mLeft = CSSConstants.UNDEFINED;
mLayoutDirection = 0;
mMeasureFunction = null;
mData = null;
@ -176,12 +193,6 @@ public class CSSNode implements CSSNodeAPI<CSSNode> {
jni_CSSNodeStyleSetDirection(mNativePointer, direction.ordinal());
}
private native int jni_CSSNodeLayoutGetDirection(long nativePointer);
@Override
public CSSDirection getLayoutDirection() {
return CSSDirection.values()[jni_CSSNodeLayoutGetDirection(mNativePointer)];
}
private native int jni_CSSNodeStyleGetFlexDirection(long nativePointer);
@Override
public CSSFlexDirection getFlexDirection() {
@ -450,28 +461,29 @@ public class CSSNode implements CSSNodeAPI<CSSNode> {
jni_CSSNodeStyleSetMaxHeight(mNativePointer, maxheight);
}
private native float jni_CSSNodeLayoutGetLeft(long nativePointer);
@Override
public float getLayoutX() {
return jni_CSSNodeLayoutGetLeft(mNativePointer);
return mLeft;
}
private native float jni_CSSNodeLayoutGetTop(long nativePointer);
@Override
public float getLayoutY() {
return jni_CSSNodeLayoutGetTop(mNativePointer);
return mTop;
}
private native float jni_CSSNodeLayoutGetWidth(long nativePointer);
@Override
public float getLayoutWidth() {
return jni_CSSNodeLayoutGetWidth(mNativePointer);
return mWidth;
}
private native float jni_CSSNodeLayoutGetHeight(long nativePointer);
@Override
public float getLayoutHeight() {
return jni_CSSNodeLayoutGetHeight(mNativePointer);
return mHeight;
}
@Override
public CSSDirection getLayoutDirection() {
return CSSDirection.values()[mLayoutDirection];
}
private native void jni_CSSNodeSetHasMeasureFunc(long nativePointer, boolean hasMeasureFunc);