Set layout outputs on java object from C
Reviewed By: lexs Differential Revision: D4077968 fbshipit-source-id: bce86ba610cd5ae36cfb45d78b2609c63a14cfa3
This commit is contained in:
parent
8e69a9f695
commit
844cafd883
|
@ -45,6 +45,17 @@ public class CSSNode implements CSSNodeAPI<CSSNode> {
|
||||||
private boolean mHasSetBorder = false;
|
private boolean mHasSetBorder = false;
|
||||||
private boolean mHasSetPosition = 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();
|
private native long jni_CSSNodeNew();
|
||||||
public CSSNode() {
|
public CSSNode() {
|
||||||
mNativePointer = jni_CSSNodeNew();
|
mNativePointer = jni_CSSNodeNew();
|
||||||
|
@ -73,6 +84,12 @@ public class CSSNode implements CSSNodeAPI<CSSNode> {
|
||||||
mHasSetBorder = false;
|
mHasSetBorder = false;
|
||||||
mHasSetPosition = false;
|
mHasSetPosition = false;
|
||||||
|
|
||||||
|
mWidth = CSSConstants.UNDEFINED;
|
||||||
|
mHeight = CSSConstants.UNDEFINED;
|
||||||
|
mTop = CSSConstants.UNDEFINED;
|
||||||
|
mLeft = CSSConstants.UNDEFINED;
|
||||||
|
mLayoutDirection = 0;
|
||||||
|
|
||||||
mMeasureFunction = null;
|
mMeasureFunction = null;
|
||||||
mData = null;
|
mData = null;
|
||||||
|
|
||||||
|
@ -176,12 +193,6 @@ public class CSSNode implements CSSNodeAPI<CSSNode> {
|
||||||
jni_CSSNodeStyleSetDirection(mNativePointer, direction.ordinal());
|
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);
|
private native int jni_CSSNodeStyleGetFlexDirection(long nativePointer);
|
||||||
@Override
|
@Override
|
||||||
public CSSFlexDirection getFlexDirection() {
|
public CSSFlexDirection getFlexDirection() {
|
||||||
|
@ -450,28 +461,29 @@ public class CSSNode implements CSSNodeAPI<CSSNode> {
|
||||||
jni_CSSNodeStyleSetMaxHeight(mNativePointer, maxheight);
|
jni_CSSNodeStyleSetMaxHeight(mNativePointer, maxheight);
|
||||||
}
|
}
|
||||||
|
|
||||||
private native float jni_CSSNodeLayoutGetLeft(long nativePointer);
|
|
||||||
@Override
|
@Override
|
||||||
public float getLayoutX() {
|
public float getLayoutX() {
|
||||||
return jni_CSSNodeLayoutGetLeft(mNativePointer);
|
return mLeft;
|
||||||
}
|
}
|
||||||
|
|
||||||
private native float jni_CSSNodeLayoutGetTop(long nativePointer);
|
|
||||||
@Override
|
@Override
|
||||||
public float getLayoutY() {
|
public float getLayoutY() {
|
||||||
return jni_CSSNodeLayoutGetTop(mNativePointer);
|
return mTop;
|
||||||
}
|
}
|
||||||
|
|
||||||
private native float jni_CSSNodeLayoutGetWidth(long nativePointer);
|
|
||||||
@Override
|
@Override
|
||||||
public float getLayoutWidth() {
|
public float getLayoutWidth() {
|
||||||
return jni_CSSNodeLayoutGetWidth(mNativePointer);
|
return mWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
private native float jni_CSSNodeLayoutGetHeight(long nativePointer);
|
|
||||||
@Override
|
@Override
|
||||||
public float getLayoutHeight() {
|
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);
|
private native void jni_CSSNodeSetHasMeasureFunc(long nativePointer, boolean hasMeasureFunc);
|
||||||
|
|
Loading…
Reference in New Issue