Rename enums
Summary: new name, start by renaming enums Differential Revision: D4244360 fbshipit-source-id: c9fcbdd231098c9ff230a6055676bbc7cbd11001
This commit is contained in:
committed by
Facebook Github Bot
parent
07cf47baad
commit
42b6f6b6e5
@@ -13,10 +13,10 @@ import com.facebook.proguard.annotations.DoNotStrip;
|
||||
|
||||
/**
|
||||
* Inteface for recieving logs from native layer. Use by setting CSSNode.setLogger(myLogger);
|
||||
* See CSSLogLevel for the different log levels.
|
||||
* See YogaLogLevel for the different log levels.
|
||||
*/
|
||||
@DoNotStrip
|
||||
public interface CSSLogger {
|
||||
@DoNotStrip
|
||||
void log(CSSLogLevel level, String message);
|
||||
void log(YogaLogLevel level, String message);
|
||||
}
|
||||
|
@@ -39,13 +39,13 @@ public class CSSNode implements CSSNodeAPI<CSSNode> {
|
||||
int feature,
|
||||
boolean enabled);
|
||||
public static void setExperimentalFeatureEnabled(
|
||||
CSSExperimentalFeature feature,
|
||||
YogaExperimentalFeature feature,
|
||||
boolean enabled) {
|
||||
jni_CSSLayoutSetExperimentalFeatureEnabled(feature.intValue(), enabled);
|
||||
}
|
||||
|
||||
private static native boolean jni_CSSLayoutIsExperimentalFeatureEnabled(int feature);
|
||||
public static boolean isExperimentalFeatureEnabled(CSSExperimentalFeature feature) {
|
||||
public static boolean isExperimentalFeatureEnabled(YogaExperimentalFeature feature) {
|
||||
return jni_CSSLayoutIsExperimentalFeatureEnabled(feature.intValue());
|
||||
}
|
||||
|
||||
@@ -61,13 +61,13 @@ public class CSSNode implements CSSNodeAPI<CSSNode> {
|
||||
private boolean mHasSetPosition = false;
|
||||
|
||||
@DoNotStrip
|
||||
private float mWidth = CSSConstants.UNDEFINED;
|
||||
private float mWidth = YogaConstants.UNDEFINED;
|
||||
@DoNotStrip
|
||||
private float mHeight = CSSConstants.UNDEFINED;
|
||||
private float mHeight = YogaConstants.UNDEFINED;
|
||||
@DoNotStrip
|
||||
private float mTop = CSSConstants.UNDEFINED;
|
||||
private float mTop = YogaConstants.UNDEFINED;
|
||||
@DoNotStrip
|
||||
private float mLeft = CSSConstants.UNDEFINED;
|
||||
private float mLeft = YogaConstants.UNDEFINED;
|
||||
@DoNotStrip
|
||||
private int mLayoutDirection = 0;
|
||||
|
||||
@@ -97,10 +97,10 @@ public class CSSNode implements CSSNodeAPI<CSSNode> {
|
||||
mHasSetBorder = false;
|
||||
mHasSetPosition = false;
|
||||
|
||||
mWidth = CSSConstants.UNDEFINED;
|
||||
mHeight = CSSConstants.UNDEFINED;
|
||||
mTop = CSSConstants.UNDEFINED;
|
||||
mLeft = CSSConstants.UNDEFINED;
|
||||
mWidth = YogaConstants.UNDEFINED;
|
||||
mHeight = YogaConstants.UNDEFINED;
|
||||
mTop = YogaConstants.UNDEFINED;
|
||||
mLeft = YogaConstants.UNDEFINED;
|
||||
mLayoutDirection = 0;
|
||||
|
||||
mMeasureFunction = null;
|
||||
@@ -193,103 +193,103 @@ public class CSSNode implements CSSNodeAPI<CSSNode> {
|
||||
|
||||
private native int jni_CSSNodeStyleGetDirection(long nativePointer);
|
||||
@Override
|
||||
public CSSDirection getStyleDirection() {
|
||||
return CSSDirection.values()[jni_CSSNodeStyleGetDirection(mNativePointer)];
|
||||
public YogaDirection getStyleDirection() {
|
||||
return YogaDirection.values()[jni_CSSNodeStyleGetDirection(mNativePointer)];
|
||||
}
|
||||
|
||||
private native void jni_CSSNodeStyleSetDirection(long nativePointer, int direction);
|
||||
@Override
|
||||
public void setDirection(CSSDirection direction) {
|
||||
public void setDirection(YogaDirection direction) {
|
||||
jni_CSSNodeStyleSetDirection(mNativePointer, direction.intValue());
|
||||
}
|
||||
|
||||
private native int jni_CSSNodeStyleGetFlexDirection(long nativePointer);
|
||||
@Override
|
||||
public CSSFlexDirection getFlexDirection() {
|
||||
return CSSFlexDirection.values()[jni_CSSNodeStyleGetFlexDirection(mNativePointer)];
|
||||
public YogaFlexDirection getFlexDirection() {
|
||||
return YogaFlexDirection.values()[jni_CSSNodeStyleGetFlexDirection(mNativePointer)];
|
||||
}
|
||||
|
||||
private native void jni_CSSNodeStyleSetFlexDirection(long nativePointer, int flexDirection);
|
||||
@Override
|
||||
public void setFlexDirection(CSSFlexDirection flexDirection) {
|
||||
public void setFlexDirection(YogaFlexDirection flexDirection) {
|
||||
jni_CSSNodeStyleSetFlexDirection(mNativePointer, flexDirection.intValue());
|
||||
}
|
||||
|
||||
private native int jni_CSSNodeStyleGetJustifyContent(long nativePointer);
|
||||
@Override
|
||||
public CSSJustify getJustifyContent() {
|
||||
return CSSJustify.values()[jni_CSSNodeStyleGetJustifyContent(mNativePointer)];
|
||||
public YogaJustify getJustifyContent() {
|
||||
return YogaJustify.values()[jni_CSSNodeStyleGetJustifyContent(mNativePointer)];
|
||||
}
|
||||
|
||||
private native void jni_CSSNodeStyleSetJustifyContent(long nativePointer, int justifyContent);
|
||||
@Override
|
||||
public void setJustifyContent(CSSJustify justifyContent) {
|
||||
public void setJustifyContent(YogaJustify justifyContent) {
|
||||
jni_CSSNodeStyleSetJustifyContent(mNativePointer, justifyContent.intValue());
|
||||
}
|
||||
|
||||
private native int jni_CSSNodeStyleGetAlignItems(long nativePointer);
|
||||
@Override
|
||||
public CSSAlign getAlignItems() {
|
||||
return CSSAlign.values()[jni_CSSNodeStyleGetAlignItems(mNativePointer)];
|
||||
public YogaAlign getAlignItems() {
|
||||
return YogaAlign.values()[jni_CSSNodeStyleGetAlignItems(mNativePointer)];
|
||||
}
|
||||
|
||||
private native void jni_CSSNodeStyleSetAlignItems(long nativePointer, int alignItems);
|
||||
@Override
|
||||
public void setAlignItems(CSSAlign alignItems) {
|
||||
public void setAlignItems(YogaAlign alignItems) {
|
||||
jni_CSSNodeStyleSetAlignItems(mNativePointer, alignItems.intValue());
|
||||
}
|
||||
|
||||
private native int jni_CSSNodeStyleGetAlignSelf(long nativePointer);
|
||||
@Override
|
||||
public CSSAlign getAlignSelf() {
|
||||
return CSSAlign.values()[jni_CSSNodeStyleGetAlignSelf(mNativePointer)];
|
||||
public YogaAlign getAlignSelf() {
|
||||
return YogaAlign.values()[jni_CSSNodeStyleGetAlignSelf(mNativePointer)];
|
||||
}
|
||||
|
||||
private native void jni_CSSNodeStyleSetAlignSelf(long nativePointer, int alignSelf);
|
||||
@Override
|
||||
public void setAlignSelf(CSSAlign alignSelf) {
|
||||
public void setAlignSelf(YogaAlign alignSelf) {
|
||||
jni_CSSNodeStyleSetAlignSelf(mNativePointer, alignSelf.intValue());
|
||||
}
|
||||
|
||||
private native int jni_CSSNodeStyleGetAlignContent(long nativePointer);
|
||||
@Override
|
||||
public CSSAlign getAlignContent() {
|
||||
return CSSAlign.values()[jni_CSSNodeStyleGetAlignContent(mNativePointer)];
|
||||
public YogaAlign getAlignContent() {
|
||||
return YogaAlign.values()[jni_CSSNodeStyleGetAlignContent(mNativePointer)];
|
||||
}
|
||||
|
||||
private native void jni_CSSNodeStyleSetAlignContent(long nativePointer, int alignContent);
|
||||
@Override
|
||||
public void setAlignContent(CSSAlign alignContent) {
|
||||
public void setAlignContent(YogaAlign alignContent) {
|
||||
jni_CSSNodeStyleSetAlignContent(mNativePointer, alignContent.intValue());
|
||||
}
|
||||
|
||||
private native int jni_CSSNodeStyleGetPositionType(long nativePointer);
|
||||
@Override
|
||||
public CSSPositionType getPositionType() {
|
||||
return CSSPositionType.values()[jni_CSSNodeStyleGetPositionType(mNativePointer)];
|
||||
public YogaPositionType getPositionType() {
|
||||
return YogaPositionType.values()[jni_CSSNodeStyleGetPositionType(mNativePointer)];
|
||||
}
|
||||
|
||||
private native void jni_CSSNodeStyleSetPositionType(long nativePointer, int positionType);
|
||||
@Override
|
||||
public void setPositionType(CSSPositionType positionType) {
|
||||
public void setPositionType(YogaPositionType positionType) {
|
||||
jni_CSSNodeStyleSetPositionType(mNativePointer, positionType.intValue());
|
||||
}
|
||||
|
||||
private native void jni_CSSNodeStyleSetFlexWrap(long nativePointer, int wrapType);
|
||||
@Override
|
||||
public void setWrap(CSSWrap flexWrap) {
|
||||
public void setWrap(YogaWrap flexWrap) {
|
||||
jni_CSSNodeStyleSetFlexWrap(mNativePointer, flexWrap.intValue());
|
||||
}
|
||||
|
||||
private native int jni_CSSNodeStyleGetOverflow(long nativePointer);
|
||||
@Override
|
||||
public CSSOverflow getOverflow() {
|
||||
return CSSOverflow.values()[jni_CSSNodeStyleGetOverflow(mNativePointer)];
|
||||
public YogaOverflow getOverflow() {
|
||||
return YogaOverflow.values()[jni_CSSNodeStyleGetOverflow(mNativePointer)];
|
||||
}
|
||||
|
||||
private native void jni_CSSNodeStyleSetOverflow(long nativePointer, int overflow);
|
||||
@Override
|
||||
public void setOverflow(CSSOverflow overflow) {
|
||||
public void setOverflow(YogaOverflow overflow) {
|
||||
jni_CSSNodeStyleSetOverflow(mNativePointer, overflow.intValue());
|
||||
}
|
||||
|
||||
@@ -337,64 +337,64 @@ public class CSSNode implements CSSNodeAPI<CSSNode> {
|
||||
|
||||
private native float jni_CSSNodeStyleGetMargin(long nativePointer, int edge);
|
||||
@Override
|
||||
public float getMargin(CSSEdge edge) {
|
||||
public float getMargin(YogaEdge edge) {
|
||||
if (!mHasSetMargin) {
|
||||
return edge.intValue() < CSSEdge.START.intValue() ? 0 : CSSConstants.UNDEFINED;
|
||||
return edge.intValue() < YogaEdge.START.intValue() ? 0 : YogaConstants.UNDEFINED;
|
||||
}
|
||||
return jni_CSSNodeStyleGetMargin(mNativePointer, edge.intValue());
|
||||
}
|
||||
|
||||
private native void jni_CSSNodeStyleSetMargin(long nativePointer, int edge, float margin);
|
||||
@Override
|
||||
public void setMargin(CSSEdge edge, float margin) {
|
||||
public void setMargin(YogaEdge edge, float margin) {
|
||||
mHasSetMargin = true;
|
||||
jni_CSSNodeStyleSetMargin(mNativePointer, edge.intValue(), margin);
|
||||
}
|
||||
|
||||
private native float jni_CSSNodeStyleGetPadding(long nativePointer, int edge);
|
||||
@Override
|
||||
public float getPadding(CSSEdge edge) {
|
||||
public float getPadding(YogaEdge edge) {
|
||||
if (!mHasSetPadding) {
|
||||
return edge.intValue() < CSSEdge.START.intValue() ? 0 : CSSConstants.UNDEFINED;
|
||||
return edge.intValue() < YogaEdge.START.intValue() ? 0 : YogaConstants.UNDEFINED;
|
||||
}
|
||||
return jni_CSSNodeStyleGetPadding(mNativePointer, edge.intValue());
|
||||
}
|
||||
|
||||
private native void jni_CSSNodeStyleSetPadding(long nativePointer, int edge, float padding);
|
||||
@Override
|
||||
public void setPadding(CSSEdge edge, float padding) {
|
||||
public void setPadding(YogaEdge edge, float padding) {
|
||||
mHasSetPadding = true;
|
||||
jni_CSSNodeStyleSetPadding(mNativePointer, edge.intValue(), padding);
|
||||
}
|
||||
|
||||
private native float jni_CSSNodeStyleGetBorder(long nativePointer, int edge);
|
||||
@Override
|
||||
public float getBorder(CSSEdge edge) {
|
||||
public float getBorder(YogaEdge edge) {
|
||||
if (!mHasSetBorder) {
|
||||
return edge.intValue() < CSSEdge.START.intValue() ? 0 : CSSConstants.UNDEFINED;
|
||||
return edge.intValue() < YogaEdge.START.intValue() ? 0 : YogaConstants.UNDEFINED;
|
||||
}
|
||||
return jni_CSSNodeStyleGetBorder(mNativePointer, edge.intValue());
|
||||
}
|
||||
|
||||
private native void jni_CSSNodeStyleSetBorder(long nativePointer, int edge, float border);
|
||||
@Override
|
||||
public void setBorder(CSSEdge edge, float border) {
|
||||
public void setBorder(YogaEdge edge, float border) {
|
||||
mHasSetBorder = true;
|
||||
jni_CSSNodeStyleSetBorder(mNativePointer, edge.intValue(), border);
|
||||
}
|
||||
|
||||
private native float jni_CSSNodeStyleGetPosition(long nativePointer, int edge);
|
||||
@Override
|
||||
public float getPosition(CSSEdge edge) {
|
||||
public float getPosition(YogaEdge edge) {
|
||||
if (!mHasSetPosition) {
|
||||
return CSSConstants.UNDEFINED;
|
||||
return YogaConstants.UNDEFINED;
|
||||
}
|
||||
return jni_CSSNodeStyleGetPosition(mNativePointer, edge.intValue());
|
||||
}
|
||||
|
||||
private native void jni_CSSNodeStyleSetPosition(long nativePointer, int edge, float position);
|
||||
@Override
|
||||
public void setPosition(CSSEdge edge, float position) {
|
||||
public void setPosition(YogaEdge edge, float position) {
|
||||
mHasSetPosition = true;
|
||||
jni_CSSNodeStyleSetPosition(mNativePointer, edge.intValue(), position);
|
||||
}
|
||||
@@ -502,8 +502,8 @@ public class CSSNode implements CSSNodeAPI<CSSNode> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public CSSDirection getLayoutDirection() {
|
||||
return CSSDirection.values()[mLayoutDirection];
|
||||
public YogaDirection getLayoutDirection() {
|
||||
return YogaDirection.values()[mLayoutDirection];
|
||||
}
|
||||
|
||||
private native void jni_CSSNodeSetHasMeasureFunc(long nativePointer, boolean hasMeasureFunc);
|
||||
@@ -527,9 +527,9 @@ public class CSSNode implements CSSNodeAPI<CSSNode> {
|
||||
return mMeasureFunction.measure(
|
||||
this,
|
||||
width,
|
||||
CSSMeasureMode.values()[widthMode],
|
||||
YogaMeasureMode.values()[widthMode],
|
||||
height,
|
||||
CSSMeasureMode.values()[heightMode]);
|
||||
YogaMeasureMode.values()[heightMode]);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -18,9 +18,9 @@ public interface CSSNodeAPI<CSSNodeType extends CSSNodeAPI> {
|
||||
long measure(
|
||||
CSSNodeAPI node,
|
||||
float width,
|
||||
CSSMeasureMode widthMode,
|
||||
YogaMeasureMode widthMode,
|
||||
float height,
|
||||
CSSMeasureMode heightMode);
|
||||
YogaMeasureMode heightMode);
|
||||
}
|
||||
|
||||
int getChildCount();
|
||||
@@ -37,21 +37,21 @@ public interface CSSNodeAPI<CSSNodeType extends CSSNodeAPI> {
|
||||
void dirty();
|
||||
void markLayoutSeen();
|
||||
void copyStyle(CSSNodeType srcNode);
|
||||
CSSDirection getStyleDirection();
|
||||
void setDirection(CSSDirection direction);
|
||||
CSSFlexDirection getFlexDirection();
|
||||
void setFlexDirection(CSSFlexDirection flexDirection);
|
||||
CSSJustify getJustifyContent();
|
||||
void setJustifyContent(CSSJustify justifyContent);
|
||||
CSSAlign getAlignItems();
|
||||
void setAlignItems(CSSAlign alignItems);
|
||||
CSSAlign getAlignSelf();
|
||||
void setAlignSelf(CSSAlign alignSelf);
|
||||
CSSAlign getAlignContent();
|
||||
void setAlignContent(CSSAlign alignContent);
|
||||
CSSPositionType getPositionType();
|
||||
void setPositionType(CSSPositionType positionType);
|
||||
void setWrap(CSSWrap flexWrap);
|
||||
YogaDirection getStyleDirection();
|
||||
void setDirection(YogaDirection direction);
|
||||
YogaFlexDirection getFlexDirection();
|
||||
void setFlexDirection(YogaFlexDirection flexDirection);
|
||||
YogaJustify getJustifyContent();
|
||||
void setJustifyContent(YogaJustify justifyContent);
|
||||
YogaAlign getAlignItems();
|
||||
void setAlignItems(YogaAlign alignItems);
|
||||
YogaAlign getAlignSelf();
|
||||
void setAlignSelf(YogaAlign alignSelf);
|
||||
YogaAlign getAlignContent();
|
||||
void setAlignContent(YogaAlign alignContent);
|
||||
YogaPositionType getPositionType();
|
||||
void setPositionType(YogaPositionType positionType);
|
||||
void setWrap(YogaWrap flexWrap);
|
||||
void setFlex(float flex);
|
||||
float getFlexGrow();
|
||||
void setFlexGrow(float flexGrow);
|
||||
@@ -59,14 +59,14 @@ public interface CSSNodeAPI<CSSNodeType extends CSSNodeAPI> {
|
||||
void setFlexShrink(float flexShrink);
|
||||
float getFlexBasis();
|
||||
void setFlexBasis(float flexBasis);
|
||||
float getMargin(CSSEdge edge);
|
||||
void setMargin(CSSEdge edge, float margin);
|
||||
float getPadding(CSSEdge edge);
|
||||
void setPadding(CSSEdge edge, float padding);
|
||||
float getBorder(CSSEdge edge);
|
||||
void setBorder(CSSEdge edge, float border);
|
||||
float getPosition(CSSEdge edge);
|
||||
void setPosition(CSSEdge edge, float position);
|
||||
float getMargin(YogaEdge edge);
|
||||
void setMargin(YogaEdge edge, float margin);
|
||||
float getPadding(YogaEdge edge);
|
||||
void setPadding(YogaEdge edge, float padding);
|
||||
float getBorder(YogaEdge edge);
|
||||
void setBorder(YogaEdge edge, float border);
|
||||
float getPosition(YogaEdge edge);
|
||||
void setPosition(YogaEdge edge, float position);
|
||||
float getWidth();
|
||||
void setWidth(float width);
|
||||
float getHeight();
|
||||
@@ -83,9 +83,9 @@ public interface CSSNodeAPI<CSSNodeType extends CSSNodeAPI> {
|
||||
float getLayoutY();
|
||||
float getLayoutWidth();
|
||||
float getLayoutHeight();
|
||||
CSSDirection getLayoutDirection();
|
||||
CSSOverflow getOverflow();
|
||||
void setOverflow(CSSOverflow overflow);
|
||||
YogaDirection getLayoutDirection();
|
||||
YogaOverflow getOverflow();
|
||||
void setOverflow(YogaOverflow overflow);
|
||||
void setData(Object data);
|
||||
Object getData();
|
||||
void reset();
|
||||
|
@@ -12,7 +12,7 @@ package com.facebook.csslayout;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
|
||||
@DoNotStrip
|
||||
public enum CSSAlign {
|
||||
public enum YogaAlign {
|
||||
AUTO(0),
|
||||
FLEX_START(1),
|
||||
CENTER(2),
|
||||
@@ -21,7 +21,7 @@ public enum CSSAlign {
|
||||
|
||||
private int mIntValue;
|
||||
|
||||
CSSAlign(int intValue) {
|
||||
YogaAlign(int intValue) {
|
||||
mIntValue = intValue;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public enum CSSAlign {
|
||||
return mIntValue;
|
||||
}
|
||||
|
||||
public static CSSAlign fromInt(int value) {
|
||||
public static YogaAlign fromInt(int value) {
|
||||
switch (value) {
|
||||
case 0: return AUTO;
|
||||
case 1: return FLEX_START;
|
@@ -9,7 +9,7 @@
|
||||
|
||||
package com.facebook.csslayout;
|
||||
|
||||
public class CSSConstants {
|
||||
public class YogaConstants {
|
||||
|
||||
public static final float UNDEFINED = Float.NaN;
|
||||
|
@@ -12,13 +12,13 @@ package com.facebook.csslayout;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
|
||||
@DoNotStrip
|
||||
public enum CSSDimension {
|
||||
public enum YogaDimension {
|
||||
WIDTH(0),
|
||||
HEIGHT(1);
|
||||
|
||||
private int mIntValue;
|
||||
|
||||
CSSDimension(int intValue) {
|
||||
YogaDimension(int intValue) {
|
||||
mIntValue = intValue;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public enum CSSDimension {
|
||||
return mIntValue;
|
||||
}
|
||||
|
||||
public static CSSDimension fromInt(int value) {
|
||||
public static YogaDimension fromInt(int value) {
|
||||
switch (value) {
|
||||
case 0: return WIDTH;
|
||||
case 1: return HEIGHT;
|
@@ -12,14 +12,14 @@ package com.facebook.csslayout;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
|
||||
@DoNotStrip
|
||||
public enum CSSDirection {
|
||||
public enum YogaDirection {
|
||||
INHERIT(0),
|
||||
LTR(1),
|
||||
RTL(2);
|
||||
|
||||
private int mIntValue;
|
||||
|
||||
CSSDirection(int intValue) {
|
||||
YogaDirection(int intValue) {
|
||||
mIntValue = intValue;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public enum CSSDirection {
|
||||
return mIntValue;
|
||||
}
|
||||
|
||||
public static CSSDirection fromInt(int value) {
|
||||
public static YogaDirection fromInt(int value) {
|
||||
switch (value) {
|
||||
case 0: return INHERIT;
|
||||
case 1: return LTR;
|
@@ -12,7 +12,7 @@ package com.facebook.csslayout;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
|
||||
@DoNotStrip
|
||||
public enum CSSEdge {
|
||||
public enum YogaEdge {
|
||||
LEFT(0),
|
||||
TOP(1),
|
||||
RIGHT(2),
|
||||
@@ -25,7 +25,7 @@ public enum CSSEdge {
|
||||
|
||||
private int mIntValue;
|
||||
|
||||
CSSEdge(int intValue) {
|
||||
YogaEdge(int intValue) {
|
||||
mIntValue = intValue;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public enum CSSEdge {
|
||||
return mIntValue;
|
||||
}
|
||||
|
||||
public static CSSEdge fromInt(int value) {
|
||||
public static YogaEdge fromInt(int value) {
|
||||
switch (value) {
|
||||
case 0: return LEFT;
|
||||
case 1: return TOP;
|
@@ -12,13 +12,13 @@ package com.facebook.csslayout;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
|
||||
@DoNotStrip
|
||||
public enum CSSExperimentalFeature {
|
||||
public enum YogaExperimentalFeature {
|
||||
ROUNDING(0),
|
||||
WEB_FLEX_BASIS(1);
|
||||
|
||||
private int mIntValue;
|
||||
|
||||
CSSExperimentalFeature(int intValue) {
|
||||
YogaExperimentalFeature(int intValue) {
|
||||
mIntValue = intValue;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public enum CSSExperimentalFeature {
|
||||
return mIntValue;
|
||||
}
|
||||
|
||||
public static CSSExperimentalFeature fromInt(int value) {
|
||||
public static YogaExperimentalFeature fromInt(int value) {
|
||||
switch (value) {
|
||||
case 0: return ROUNDING;
|
||||
case 1: return WEB_FLEX_BASIS;
|
@@ -12,7 +12,7 @@ package com.facebook.csslayout;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
|
||||
@DoNotStrip
|
||||
public enum CSSFlexDirection {
|
||||
public enum YogaFlexDirection {
|
||||
COLUMN(0),
|
||||
COLUMN_REVERSE(1),
|
||||
ROW(2),
|
||||
@@ -20,7 +20,7 @@ public enum CSSFlexDirection {
|
||||
|
||||
private int mIntValue;
|
||||
|
||||
CSSFlexDirection(int intValue) {
|
||||
YogaFlexDirection(int intValue) {
|
||||
mIntValue = intValue;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public enum CSSFlexDirection {
|
||||
return mIntValue;
|
||||
}
|
||||
|
||||
public static CSSFlexDirection fromInt(int value) {
|
||||
public static YogaFlexDirection fromInt(int value) {
|
||||
switch (value) {
|
||||
case 0: return COLUMN;
|
||||
case 1: return COLUMN_REVERSE;
|
@@ -12,7 +12,7 @@ package com.facebook.csslayout;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
|
||||
@DoNotStrip
|
||||
public enum CSSJustify {
|
||||
public enum YogaJustify {
|
||||
FLEX_START(0),
|
||||
CENTER(1),
|
||||
FLEX_END(2),
|
||||
@@ -21,7 +21,7 @@ public enum CSSJustify {
|
||||
|
||||
private int mIntValue;
|
||||
|
||||
CSSJustify(int intValue) {
|
||||
YogaJustify(int intValue) {
|
||||
mIntValue = intValue;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public enum CSSJustify {
|
||||
return mIntValue;
|
||||
}
|
||||
|
||||
public static CSSJustify fromInt(int value) {
|
||||
public static YogaJustify fromInt(int value) {
|
||||
switch (value) {
|
||||
case 0: return FLEX_START;
|
||||
case 1: return CENTER;
|
@@ -12,7 +12,7 @@ package com.facebook.csslayout;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
|
||||
@DoNotStrip
|
||||
public enum CSSLogLevel {
|
||||
public enum YogaLogLevel {
|
||||
ERROR(0),
|
||||
WARN(1),
|
||||
INFO(2),
|
||||
@@ -21,7 +21,7 @@ public enum CSSLogLevel {
|
||||
|
||||
private int mIntValue;
|
||||
|
||||
CSSLogLevel(int intValue) {
|
||||
YogaLogLevel(int intValue) {
|
||||
mIntValue = intValue;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public enum CSSLogLevel {
|
||||
return mIntValue;
|
||||
}
|
||||
|
||||
public static CSSLogLevel fromInt(int value) {
|
||||
public static YogaLogLevel fromInt(int value) {
|
||||
switch (value) {
|
||||
case 0: return ERROR;
|
||||
case 1: return WARN;
|
@@ -12,14 +12,14 @@ package com.facebook.csslayout;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
|
||||
@DoNotStrip
|
||||
public enum CSSMeasureMode {
|
||||
public enum YogaMeasureMode {
|
||||
UNDEFINED(0),
|
||||
EXACTLY(1),
|
||||
AT_MOST(2);
|
||||
|
||||
private int mIntValue;
|
||||
|
||||
CSSMeasureMode(int intValue) {
|
||||
YogaMeasureMode(int intValue) {
|
||||
mIntValue = intValue;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public enum CSSMeasureMode {
|
||||
return mIntValue;
|
||||
}
|
||||
|
||||
public static CSSMeasureMode fromInt(int value) {
|
||||
public static YogaMeasureMode fromInt(int value) {
|
||||
switch (value) {
|
||||
case 0: return UNDEFINED;
|
||||
case 1: return EXACTLY;
|
@@ -12,14 +12,14 @@ package com.facebook.csslayout;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
|
||||
@DoNotStrip
|
||||
public enum CSSOverflow {
|
||||
public enum YogaOverflow {
|
||||
VISIBLE(0),
|
||||
HIDDEN(1),
|
||||
SCROLL(2);
|
||||
|
||||
private int mIntValue;
|
||||
|
||||
CSSOverflow(int intValue) {
|
||||
YogaOverflow(int intValue) {
|
||||
mIntValue = intValue;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public enum CSSOverflow {
|
||||
return mIntValue;
|
||||
}
|
||||
|
||||
public static CSSOverflow fromInt(int value) {
|
||||
public static YogaOverflow fromInt(int value) {
|
||||
switch (value) {
|
||||
case 0: return VISIBLE;
|
||||
case 1: return HIDDEN;
|
@@ -12,13 +12,13 @@ package com.facebook.csslayout;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
|
||||
@DoNotStrip
|
||||
public enum CSSPositionType {
|
||||
public enum YogaPositionType {
|
||||
RELATIVE(0),
|
||||
ABSOLUTE(1);
|
||||
|
||||
private int mIntValue;
|
||||
|
||||
CSSPositionType(int intValue) {
|
||||
YogaPositionType(int intValue) {
|
||||
mIntValue = intValue;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public enum CSSPositionType {
|
||||
return mIntValue;
|
||||
}
|
||||
|
||||
public static CSSPositionType fromInt(int value) {
|
||||
public static YogaPositionType fromInt(int value) {
|
||||
switch (value) {
|
||||
case 0: return RELATIVE;
|
||||
case 1: return ABSOLUTE;
|
@@ -12,14 +12,14 @@ package com.facebook.csslayout;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
|
||||
@DoNotStrip
|
||||
public enum CSSPrintOptions {
|
||||
public enum YogaPrintOptions {
|
||||
LAYOUT(1),
|
||||
STYLE(2),
|
||||
CHILDREN(4);
|
||||
|
||||
private int mIntValue;
|
||||
|
||||
CSSPrintOptions(int intValue) {
|
||||
YogaPrintOptions(int intValue) {
|
||||
mIntValue = intValue;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public enum CSSPrintOptions {
|
||||
return mIntValue;
|
||||
}
|
||||
|
||||
public static CSSPrintOptions fromInt(int value) {
|
||||
public static YogaPrintOptions fromInt(int value) {
|
||||
switch (value) {
|
||||
case 1: return LAYOUT;
|
||||
case 2: return STYLE;
|
@@ -12,13 +12,13 @@ package com.facebook.csslayout;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
|
||||
@DoNotStrip
|
||||
public enum CSSWrap {
|
||||
public enum YogaWrap {
|
||||
NO_WRAP(0),
|
||||
WRAP(1);
|
||||
|
||||
private int mIntValue;
|
||||
|
||||
CSSWrap(int intValue) {
|
||||
YogaWrap(int intValue) {
|
||||
mIntValue = intValue;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public enum CSSWrap {
|
||||
return mIntValue;
|
||||
}
|
||||
|
||||
public static CSSWrap fromInt(int value) {
|
||||
public static YogaWrap fromInt(int value) {
|
||||
switch (value) {
|
||||
case 0: return NO_WRAP;
|
||||
case 1: return WRAP;
|
@@ -40,7 +40,7 @@ static void _jniTransferLayoutOutputsRecursive(CSSNodeRef root) {
|
||||
_jniTransferLayoutOutputsRecursive(CSSNodeGetChild(root, i));
|
||||
}
|
||||
} else {
|
||||
CSSLog(CSSLogLevelError, "Java CSSNode was GCed during layout calculation\n");
|
||||
CSSLog(YGLogLevelError, "Java CSSNode was GCed during layout calculation\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,15 +48,15 @@ static void _jniPrint(CSSNodeRef node) {
|
||||
if (auto obj = jobjectContext(node)->lockLocal()) {
|
||||
cout << obj->toString() << endl;
|
||||
} else {
|
||||
CSSLog(CSSLogLevelError, "Java CSSNode was GCed during layout calculation\n");
|
||||
CSSLog(YGLogLevelError, "Java CSSNode was GCed during layout calculation\n");
|
||||
}
|
||||
}
|
||||
|
||||
static CSSSize _jniMeasureFunc(CSSNodeRef node,
|
||||
float width,
|
||||
CSSMeasureMode widthMode,
|
||||
YGMeasureMode widthMode,
|
||||
float height,
|
||||
CSSMeasureMode heightMode) {
|
||||
YGMeasureMode heightMode) {
|
||||
if (auto obj = jobjectContext(node)->lockLocal()) {
|
||||
static auto measureFunc = findClassLocal("com/facebook/csslayout/CSSNode")
|
||||
->getMethod<jlong(jfloat, jint, jfloat, jint)>("measure");
|
||||
@@ -72,31 +72,31 @@ static CSSSize _jniMeasureFunc(CSSNodeRef node,
|
||||
|
||||
return CSSSize{measuredWidth, measuredHeight};
|
||||
} else {
|
||||
CSSLog(CSSLogLevelError, "Java CSSNode was GCed during layout calculation\n");
|
||||
CSSLog(YGLogLevelError, "Java CSSNode was GCed during layout calculation\n");
|
||||
return CSSSize{
|
||||
widthMode == CSSMeasureModeUndefined ? 0 : width,
|
||||
heightMode == CSSMeasureModeUndefined ? 0 : height,
|
||||
widthMode == YGMeasureModeUndefined ? 0 : width,
|
||||
heightMode == YGMeasureModeUndefined ? 0 : height,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
struct JCSSLogLevel : public JavaClass<JCSSLogLevel> {
|
||||
static constexpr auto kJavaDescriptor = "Lcom/facebook/csslayout/CSSLogLevel;";
|
||||
struct JYogaLogLevel : public JavaClass<JYogaLogLevel> {
|
||||
static constexpr auto kJavaDescriptor = "Lcom/facebook/csslayout/YogaLogLevel;";
|
||||
};
|
||||
|
||||
static global_ref<jobject> *jLogger;
|
||||
static int _jniLog(CSSLogLevel level, const char *format, va_list args) {
|
||||
static int _jniLog(YGLogLevel level, const char *format, va_list args) {
|
||||
char buffer[256];
|
||||
int result = vsnprintf(buffer, sizeof(buffer), format, args);
|
||||
|
||||
static auto logFunc = findClassLocal("com/facebook/csslayout/CSSLogger")
|
||||
->getMethod<void(local_ref<JCSSLogLevel>, jstring)>("log");
|
||||
->getMethod<void(local_ref<JYogaLogLevel>, jstring)>("log");
|
||||
|
||||
static auto logLevelFromInt =
|
||||
JCSSLogLevel::javaClassStatic()->getStaticMethod<JCSSLogLevel::javaobject(jint)>("fromInt");
|
||||
JYogaLogLevel::javaClassStatic()->getStaticMethod<JYogaLogLevel::javaobject(jint)>("fromInt");
|
||||
|
||||
logFunc(jLogger->get(),
|
||||
logLevelFromInt(JCSSLogLevel::javaClassStatic(), static_cast<jint>(level)),
|
||||
logLevelFromInt(JYogaLogLevel::javaClassStatic(), static_cast<jint>(level)),
|
||||
Environment::current()->NewStringUTF(buffer));
|
||||
|
||||
return result;
|
||||
@@ -123,18 +123,18 @@ void jni_CSSLayoutSetLogger(alias_ref<jclass> clazz, alias_ref<jobject> logger)
|
||||
|
||||
void jni_CSSLog(alias_ref<jclass> clazz, jint level, jstring message) {
|
||||
const char *nMessage = Environment::current()->GetStringUTFChars(message, 0);
|
||||
CSSLog(static_cast<CSSLogLevel>(level), "%s", nMessage);
|
||||
CSSLog(static_cast<YGLogLevel>(level), "%s", nMessage);
|
||||
Environment::current()->ReleaseStringUTFChars(message, nMessage);
|
||||
}
|
||||
|
||||
void jni_CSSLayoutSetExperimentalFeatureEnabled(alias_ref<jclass> clazz,
|
||||
jint feature,
|
||||
jboolean enabled) {
|
||||
CSSLayoutSetExperimentalFeatureEnabled(static_cast<CSSExperimentalFeature>(feature), enabled);
|
||||
CSSLayoutSetExperimentalFeatureEnabled(static_cast<YGExperimentalFeature>(feature), enabled);
|
||||
}
|
||||
|
||||
jboolean jni_CSSLayoutIsExperimentalFeatureEnabled(alias_ref<jclass> clazz, jint feature) {
|
||||
return CSSLayoutIsExperimentalFeatureEnabled(static_cast<CSSExperimentalFeature>(feature));
|
||||
return CSSLayoutIsExperimentalFeatureEnabled(static_cast<YGExperimentalFeature>(feature));
|
||||
}
|
||||
|
||||
jint jni_CSSNodeGetInstanceCount(alias_ref<jclass> clazz) {
|
||||
@@ -176,8 +176,8 @@ void jni_CSSNodeRemoveChild(alias_ref<jobject>, jlong nativePointer, jlong child
|
||||
void jni_CSSNodeCalculateLayout(alias_ref<jobject>, jlong nativePointer) {
|
||||
const CSSNodeRef root = _jlong2CSSNodeRef(nativePointer);
|
||||
CSSNodeCalculateLayout(root,
|
||||
CSSUndefined,
|
||||
CSSUndefined,
|
||||
YGUndefined,
|
||||
YGUndefined,
|
||||
CSSNodeStyleGetDirection(_jlong2CSSNodeRef(nativePointer)));
|
||||
_jniTransferLayoutOutputsRecursive(root);
|
||||
}
|
||||
@@ -220,7 +220,7 @@ void jni_CSSNodeCopyStyle(alias_ref<jobject>, jlong dstNativePointer, jlong srcN
|
||||
#define CSS_NODE_JNI_STYLE_EDGE_PROP(javatype, type, name) \
|
||||
javatype jni_CSSNodeStyleGet##name(alias_ref<jobject>, jlong nativePointer, jint edge) { \
|
||||
return (javatype) CSSNodeStyleGet##name(_jlong2CSSNodeRef(nativePointer), \
|
||||
static_cast<CSSEdge>(edge)); \
|
||||
static_cast<YGEdge>(edge)); \
|
||||
} \
|
||||
\
|
||||
void jni_CSSNodeStyleSet##name(alias_ref<jobject>, \
|
||||
@@ -228,19 +228,19 @@ void jni_CSSNodeCopyStyle(alias_ref<jobject>, jlong dstNativePointer, jlong srcN
|
||||
jint edge, \
|
||||
javatype value) { \
|
||||
CSSNodeStyleSet##name(_jlong2CSSNodeRef(nativePointer), \
|
||||
static_cast<CSSEdge>(edge), \
|
||||
static_cast<YGEdge>(edge), \
|
||||
static_cast<type>(value)); \
|
||||
}
|
||||
|
||||
CSS_NODE_JNI_STYLE_PROP(jint, CSSDirection, Direction);
|
||||
CSS_NODE_JNI_STYLE_PROP(jint, CSSFlexDirection, FlexDirection);
|
||||
CSS_NODE_JNI_STYLE_PROP(jint, CSSJustify, JustifyContent);
|
||||
CSS_NODE_JNI_STYLE_PROP(jint, CSSAlign, AlignItems);
|
||||
CSS_NODE_JNI_STYLE_PROP(jint, CSSAlign, AlignSelf);
|
||||
CSS_NODE_JNI_STYLE_PROP(jint, CSSAlign, AlignContent);
|
||||
CSS_NODE_JNI_STYLE_PROP(jint, CSSPositionType, PositionType);
|
||||
CSS_NODE_JNI_STYLE_PROP(jint, CSSWrap, FlexWrap);
|
||||
CSS_NODE_JNI_STYLE_PROP(jint, CSSOverflow, Overflow);
|
||||
CSS_NODE_JNI_STYLE_PROP(jint, YGDirection, Direction);
|
||||
CSS_NODE_JNI_STYLE_PROP(jint, YGFlexDirection, FlexDirection);
|
||||
CSS_NODE_JNI_STYLE_PROP(jint, YGJustify, JustifyContent);
|
||||
CSS_NODE_JNI_STYLE_PROP(jint, YGAlign, AlignItems);
|
||||
CSS_NODE_JNI_STYLE_PROP(jint, YGAlign, AlignSelf);
|
||||
CSS_NODE_JNI_STYLE_PROP(jint, YGAlign, AlignContent);
|
||||
CSS_NODE_JNI_STYLE_PROP(jint, YGPositionType, PositionType);
|
||||
CSS_NODE_JNI_STYLE_PROP(jint, YGWrap, FlexWrap);
|
||||
CSS_NODE_JNI_STYLE_PROP(jint, YGOverflow, Overflow);
|
||||
|
||||
void jni_CSSNodeStyleSetFlex(alias_ref<jobject>, jlong nativePointer, jfloat value) {
|
||||
CSSNodeStyleSetFlex(_jlong2CSSNodeRef(nativePointer), static_cast<float>(value));
|
||||
|
@@ -23,13 +23,13 @@ public class CSSLayoutAbsolutePositionTest {
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setPositionType(CSSPositionType.ABSOLUTE);
|
||||
root_child0.setPosition(CSSEdge.START, 10f);
|
||||
root_child0.setPosition(CSSEdge.TOP, 10f);
|
||||
root_child0.setPositionType(YogaPositionType.ABSOLUTE);
|
||||
root_child0.setPosition(YogaEdge.START, 10f);
|
||||
root_child0.setPosition(YogaEdge.TOP, 10f);
|
||||
root_child0.setWidth(10f);
|
||||
root_child0.setHeight(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -42,7 +42,7 @@ public class CSSLayoutAbsolutePositionTest {
|
||||
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -63,13 +63,13 @@ public class CSSLayoutAbsolutePositionTest {
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setPositionType(CSSPositionType.ABSOLUTE);
|
||||
root_child0.setPosition(CSSEdge.END, 10f);
|
||||
root_child0.setPosition(CSSEdge.BOTTOM, 10f);
|
||||
root_child0.setPositionType(YogaPositionType.ABSOLUTE);
|
||||
root_child0.setPosition(YogaEdge.END, 10f);
|
||||
root_child0.setPosition(YogaEdge.BOTTOM, 10f);
|
||||
root_child0.setWidth(10f);
|
||||
root_child0.setHeight(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -82,7 +82,7 @@ public class CSSLayoutAbsolutePositionTest {
|
||||
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -103,13 +103,13 @@ public class CSSLayoutAbsolutePositionTest {
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setPositionType(CSSPositionType.ABSOLUTE);
|
||||
root_child0.setPosition(CSSEdge.START, 10f);
|
||||
root_child0.setPosition(CSSEdge.TOP, 10f);
|
||||
root_child0.setPosition(CSSEdge.END, 10f);
|
||||
root_child0.setPosition(CSSEdge.BOTTOM, 10f);
|
||||
root_child0.setPositionType(YogaPositionType.ABSOLUTE);
|
||||
root_child0.setPosition(YogaEdge.START, 10f);
|
||||
root_child0.setPosition(YogaEdge.TOP, 10f);
|
||||
root_child0.setPosition(YogaEdge.END, 10f);
|
||||
root_child0.setPosition(YogaEdge.BOTTOM, 10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -122,7 +122,7 @@ public class CSSLayoutAbsolutePositionTest {
|
||||
assertEquals(80f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(80f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -143,15 +143,15 @@ public class CSSLayoutAbsolutePositionTest {
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setPositionType(CSSPositionType.ABSOLUTE);
|
||||
root_child0.setPosition(CSSEdge.START, 10f);
|
||||
root_child0.setPosition(CSSEdge.TOP, 10f);
|
||||
root_child0.setPosition(CSSEdge.END, 10f);
|
||||
root_child0.setPosition(CSSEdge.BOTTOM, 10f);
|
||||
root_child0.setPositionType(YogaPositionType.ABSOLUTE);
|
||||
root_child0.setPosition(YogaEdge.START, 10f);
|
||||
root_child0.setPosition(YogaEdge.TOP, 10f);
|
||||
root_child0.setPosition(YogaEdge.END, 10f);
|
||||
root_child0.setPosition(YogaEdge.BOTTOM, 10f);
|
||||
root_child0.setWidth(10f);
|
||||
root_child0.setHeight(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -164,7 +164,7 @@ public class CSSLayoutAbsolutePositionTest {
|
||||
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -181,22 +181,22 @@ public class CSSLayoutAbsolutePositionTest {
|
||||
@Test
|
||||
public void test_do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setOverflow(CSSOverflow.HIDDEN);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setOverflow(YogaOverflow.HIDDEN);
|
||||
root.setWidth(50f);
|
||||
root.setHeight(50f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setPositionType(CSSPositionType.ABSOLUTE);
|
||||
root_child0.setPosition(CSSEdge.START, 0f);
|
||||
root_child0.setPosition(CSSEdge.TOP, 0f);
|
||||
root_child0.setPositionType(YogaPositionType.ABSOLUTE);
|
||||
root_child0.setPosition(YogaEdge.START, 0f);
|
||||
root_child0.setPosition(YogaEdge.TOP, 0f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
|
||||
final CSSNode root_child0_child0 = new CSSNode();
|
||||
root_child0_child0.setWidth(100f);
|
||||
root_child0_child0.setHeight(100f);
|
||||
root_child0.addChildAt(root_child0_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -214,7 +214,7 @@ public class CSSLayoutAbsolutePositionTest {
|
||||
assertEquals(100f, root_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(100f, root_child0_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -236,37 +236,37 @@ public class CSSLayoutAbsolutePositionTest {
|
||||
@Test
|
||||
public void test_absolute_layout_within_border() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setMargin(CSSEdge.LEFT, 10f);
|
||||
root.setMargin(CSSEdge.TOP, 10f);
|
||||
root.setMargin(CSSEdge.RIGHT, 10f);
|
||||
root.setMargin(CSSEdge.BOTTOM, 10f);
|
||||
root.setPadding(CSSEdge.LEFT, 10);
|
||||
root.setPadding(CSSEdge.TOP, 10);
|
||||
root.setPadding(CSSEdge.RIGHT, 10);
|
||||
root.setPadding(CSSEdge.BOTTOM, 10);
|
||||
root.setBorder(CSSEdge.LEFT, 10f);
|
||||
root.setBorder(CSSEdge.TOP, 10f);
|
||||
root.setBorder(CSSEdge.RIGHT, 10f);
|
||||
root.setBorder(CSSEdge.BOTTOM, 10f);
|
||||
root.setMargin(YogaEdge.LEFT, 10f);
|
||||
root.setMargin(YogaEdge.TOP, 10f);
|
||||
root.setMargin(YogaEdge.RIGHT, 10f);
|
||||
root.setMargin(YogaEdge.BOTTOM, 10f);
|
||||
root.setPadding(YogaEdge.LEFT, 10);
|
||||
root.setPadding(YogaEdge.TOP, 10);
|
||||
root.setPadding(YogaEdge.RIGHT, 10);
|
||||
root.setPadding(YogaEdge.BOTTOM, 10);
|
||||
root.setBorder(YogaEdge.LEFT, 10f);
|
||||
root.setBorder(YogaEdge.TOP, 10f);
|
||||
root.setBorder(YogaEdge.RIGHT, 10f);
|
||||
root.setBorder(YogaEdge.BOTTOM, 10f);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setPositionType(CSSPositionType.ABSOLUTE);
|
||||
root_child0.setPosition(CSSEdge.LEFT, 0f);
|
||||
root_child0.setPosition(CSSEdge.TOP, 0f);
|
||||
root_child0.setPositionType(YogaPositionType.ABSOLUTE);
|
||||
root_child0.setPosition(YogaEdge.LEFT, 0f);
|
||||
root_child0.setPosition(YogaEdge.TOP, 0f);
|
||||
root_child0.setWidth(50f);
|
||||
root_child0.setHeight(50f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
|
||||
final CSSNode root_child1 = new CSSNode();
|
||||
root_child1.setPositionType(CSSPositionType.ABSOLUTE);
|
||||
root_child1.setPosition(CSSEdge.RIGHT, 0f);
|
||||
root_child1.setPosition(CSSEdge.BOTTOM, 0f);
|
||||
root_child1.setPositionType(YogaPositionType.ABSOLUTE);
|
||||
root_child1.setPosition(YogaEdge.RIGHT, 0f);
|
||||
root_child1.setPosition(YogaEdge.BOTTOM, 0f);
|
||||
root_child1.setWidth(50f);
|
||||
root_child1.setHeight(50f);
|
||||
root.addChildAt(root_child1, 1);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(10f, root.getLayoutX(), 0.0f);
|
||||
@@ -284,7 +284,7 @@ public class CSSLayoutAbsolutePositionTest {
|
||||
assertEquals(50f, root_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(50f, root_child1.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(10f, root.getLayoutX(), 0.0f);
|
||||
|
@@ -19,7 +19,7 @@ public class CSSLayoutAlignContentTest {
|
||||
@Test
|
||||
public void test_align_content_flex_start() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setWrap(CSSWrap.WRAP);
|
||||
root.setWrap(YogaWrap.WRAP);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -47,7 +47,7 @@ public class CSSLayoutAlignContentTest {
|
||||
root_child4.setWidth(50f);
|
||||
root_child4.setHeight(10f);
|
||||
root.addChildAt(root_child4, 4);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -80,7 +80,7 @@ public class CSSLayoutAlignContentTest {
|
||||
assertEquals(50f, root_child4.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child4.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -117,8 +117,8 @@ public class CSSLayoutAlignContentTest {
|
||||
@Test
|
||||
public void test_align_content_flex_end() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setAlignContent(CSSAlign.FLEX_END);
|
||||
root.setWrap(CSSWrap.WRAP);
|
||||
root.setAlignContent(YogaAlign.FLEX_END);
|
||||
root.setWrap(YogaWrap.WRAP);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -146,7 +146,7 @@ public class CSSLayoutAlignContentTest {
|
||||
root_child4.setWidth(50f);
|
||||
root_child4.setHeight(10f);
|
||||
root.addChildAt(root_child4, 4);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -179,7 +179,7 @@ public class CSSLayoutAlignContentTest {
|
||||
assertEquals(50f, root_child4.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child4.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -216,8 +216,8 @@ public class CSSLayoutAlignContentTest {
|
||||
@Test
|
||||
public void test_align_content_center() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setAlignContent(CSSAlign.CENTER);
|
||||
root.setWrap(CSSWrap.WRAP);
|
||||
root.setAlignContent(YogaAlign.CENTER);
|
||||
root.setWrap(YogaWrap.WRAP);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -245,7 +245,7 @@ public class CSSLayoutAlignContentTest {
|
||||
root_child4.setWidth(50f);
|
||||
root_child4.setHeight(10f);
|
||||
root.addChildAt(root_child4, 4);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -278,7 +278,7 @@ public class CSSLayoutAlignContentTest {
|
||||
assertEquals(50f, root_child4.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child4.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -315,8 +315,8 @@ public class CSSLayoutAlignContentTest {
|
||||
@Test
|
||||
public void test_align_content_stretch() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setAlignContent(CSSAlign.STRETCH);
|
||||
root.setWrap(CSSWrap.WRAP);
|
||||
root.setAlignContent(YogaAlign.STRETCH);
|
||||
root.setWrap(YogaWrap.WRAP);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -339,7 +339,7 @@ public class CSSLayoutAlignContentTest {
|
||||
final CSSNode root_child4 = new CSSNode();
|
||||
root_child4.setWidth(50f);
|
||||
root.addChildAt(root_child4, 4);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -372,7 +372,7 @@ public class CSSLayoutAlignContentTest {
|
||||
assertEquals(50f, root_child4.getLayoutWidth(), 0.0f);
|
||||
assertEquals(0f, root_child4.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
|
@@ -25,7 +25,7 @@ public class CSSLayoutAlignItemsTest {
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setHeight(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -38,7 +38,7 @@ public class CSSLayoutAlignItemsTest {
|
||||
assertEquals(100f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -55,7 +55,7 @@ public class CSSLayoutAlignItemsTest {
|
||||
@Test
|
||||
public void test_align_items_center() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setAlignItems(CSSAlign.CENTER);
|
||||
root.setAlignItems(YogaAlign.CENTER);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -63,7 +63,7 @@ public class CSSLayoutAlignItemsTest {
|
||||
root_child0.setWidth(10f);
|
||||
root_child0.setHeight(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -76,7 +76,7 @@ public class CSSLayoutAlignItemsTest {
|
||||
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -93,7 +93,7 @@ public class CSSLayoutAlignItemsTest {
|
||||
@Test
|
||||
public void test_align_items_flex_start() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setAlignItems(CSSAlign.FLEX_START);
|
||||
root.setAlignItems(YogaAlign.FLEX_START);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -101,7 +101,7 @@ public class CSSLayoutAlignItemsTest {
|
||||
root_child0.setWidth(10f);
|
||||
root_child0.setHeight(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -114,7 +114,7 @@ public class CSSLayoutAlignItemsTest {
|
||||
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -131,7 +131,7 @@ public class CSSLayoutAlignItemsTest {
|
||||
@Test
|
||||
public void test_align_items_flex_end() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setAlignItems(CSSAlign.FLEX_END);
|
||||
root.setAlignItems(YogaAlign.FLEX_END);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -139,7 +139,7 @@ public class CSSLayoutAlignItemsTest {
|
||||
root_child0.setWidth(10f);
|
||||
root_child0.setHeight(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -152,7 +152,7 @@ public class CSSLayoutAlignItemsTest {
|
||||
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
|
@@ -23,11 +23,11 @@ public class CSSLayoutAlignSelfTest {
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setAlignSelf(CSSAlign.CENTER);
|
||||
root_child0.setAlignSelf(YogaAlign.CENTER);
|
||||
root_child0.setWidth(10f);
|
||||
root_child0.setHeight(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -40,7 +40,7 @@ public class CSSLayoutAlignSelfTest {
|
||||
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -61,11 +61,11 @@ public class CSSLayoutAlignSelfTest {
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setAlignSelf(CSSAlign.FLEX_END);
|
||||
root_child0.setAlignSelf(YogaAlign.FLEX_END);
|
||||
root_child0.setWidth(10f);
|
||||
root_child0.setHeight(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -78,7 +78,7 @@ public class CSSLayoutAlignSelfTest {
|
||||
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -99,11 +99,11 @@ public class CSSLayoutAlignSelfTest {
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setAlignSelf(CSSAlign.FLEX_START);
|
||||
root_child0.setAlignSelf(YogaAlign.FLEX_START);
|
||||
root_child0.setWidth(10f);
|
||||
root_child0.setHeight(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -116,7 +116,7 @@ public class CSSLayoutAlignSelfTest {
|
||||
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -133,16 +133,16 @@ public class CSSLayoutAlignSelfTest {
|
||||
@Test
|
||||
public void test_align_self_flex_end_override_flex_start() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setAlignItems(CSSAlign.FLEX_START);
|
||||
root.setAlignItems(YogaAlign.FLEX_START);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setAlignSelf(CSSAlign.FLEX_END);
|
||||
root_child0.setAlignSelf(YogaAlign.FLEX_END);
|
||||
root_child0.setWidth(10f);
|
||||
root_child0.setHeight(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -155,7 +155,7 @@ public class CSSLayoutAlignSelfTest {
|
||||
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
|
@@ -19,11 +19,11 @@ public class CSSLayoutBorderTest {
|
||||
@Test
|
||||
public void test_border_no_size() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setBorder(CSSEdge.LEFT, 10f);
|
||||
root.setBorder(CSSEdge.TOP, 10f);
|
||||
root.setBorder(CSSEdge.RIGHT, 10f);
|
||||
root.setBorder(CSSEdge.BOTTOM, 10f);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setBorder(YogaEdge.LEFT, 10f);
|
||||
root.setBorder(YogaEdge.TOP, 10f);
|
||||
root.setBorder(YogaEdge.RIGHT, 10f);
|
||||
root.setBorder(YogaEdge.BOTTOM, 10f);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -31,7 +31,7 @@ public class CSSLayoutBorderTest {
|
||||
assertEquals(20f, root.getLayoutWidth(), 0.0f);
|
||||
assertEquals(20f, root.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -43,16 +43,16 @@ public class CSSLayoutBorderTest {
|
||||
@Test
|
||||
public void test_border_container_match_child() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setBorder(CSSEdge.LEFT, 10f);
|
||||
root.setBorder(CSSEdge.TOP, 10f);
|
||||
root.setBorder(CSSEdge.RIGHT, 10f);
|
||||
root.setBorder(CSSEdge.BOTTOM, 10f);
|
||||
root.setBorder(YogaEdge.LEFT, 10f);
|
||||
root.setBorder(YogaEdge.TOP, 10f);
|
||||
root.setBorder(YogaEdge.RIGHT, 10f);
|
||||
root.setBorder(YogaEdge.BOTTOM, 10f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setWidth(10f);
|
||||
root_child0.setHeight(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -65,7 +65,7 @@ public class CSSLayoutBorderTest {
|
||||
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -82,10 +82,10 @@ public class CSSLayoutBorderTest {
|
||||
@Test
|
||||
public void test_border_flex_child() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setBorder(CSSEdge.LEFT, 10f);
|
||||
root.setBorder(CSSEdge.TOP, 10f);
|
||||
root.setBorder(CSSEdge.RIGHT, 10f);
|
||||
root.setBorder(CSSEdge.BOTTOM, 10f);
|
||||
root.setBorder(YogaEdge.LEFT, 10f);
|
||||
root.setBorder(YogaEdge.TOP, 10f);
|
||||
root.setBorder(YogaEdge.RIGHT, 10f);
|
||||
root.setBorder(YogaEdge.BOTTOM, 10f);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -93,7 +93,7 @@ public class CSSLayoutBorderTest {
|
||||
root_child0.setFlexGrow(1f);
|
||||
root_child0.setWidth(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -106,7 +106,7 @@ public class CSSLayoutBorderTest {
|
||||
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(80f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -123,17 +123,17 @@ public class CSSLayoutBorderTest {
|
||||
@Test
|
||||
public void test_border_stretch_child() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setBorder(CSSEdge.LEFT, 10f);
|
||||
root.setBorder(CSSEdge.TOP, 10f);
|
||||
root.setBorder(CSSEdge.RIGHT, 10f);
|
||||
root.setBorder(CSSEdge.BOTTOM, 10f);
|
||||
root.setBorder(YogaEdge.LEFT, 10f);
|
||||
root.setBorder(YogaEdge.TOP, 10f);
|
||||
root.setBorder(YogaEdge.RIGHT, 10f);
|
||||
root.setBorder(YogaEdge.BOTTOM, 10f);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setHeight(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -146,7 +146,7 @@ public class CSSLayoutBorderTest {
|
||||
assertEquals(80f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -163,11 +163,11 @@ public class CSSLayoutBorderTest {
|
||||
@Test
|
||||
public void test_border_center_child() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setJustifyContent(CSSJustify.CENTER);
|
||||
root.setAlignItems(CSSAlign.CENTER);
|
||||
root.setBorder(CSSEdge.START, 10f);
|
||||
root.setBorder(CSSEdge.END, 20f);
|
||||
root.setBorder(CSSEdge.BOTTOM, 20f);
|
||||
root.setJustifyContent(YogaJustify.CENTER);
|
||||
root.setAlignItems(YogaAlign.CENTER);
|
||||
root.setBorder(YogaEdge.START, 10f);
|
||||
root.setBorder(YogaEdge.END, 20f);
|
||||
root.setBorder(YogaEdge.BOTTOM, 20f);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -175,7 +175,7 @@ public class CSSLayoutBorderTest {
|
||||
root_child0.setWidth(10f);
|
||||
root_child0.setHeight(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -188,7 +188,7 @@ public class CSSLayoutBorderTest {
|
||||
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
|
@@ -32,7 +32,7 @@ public class CSSLayoutFlexDirectionTest {
|
||||
final CSSNode root_child2 = new CSSNode();
|
||||
root_child2.setHeight(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -55,7 +55,7 @@ public class CSSLayoutFlexDirectionTest {
|
||||
assertEquals(100f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -82,7 +82,7 @@ public class CSSLayoutFlexDirectionTest {
|
||||
@Test
|
||||
public void test_flex_direction_row_no_width() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
@@ -96,7 +96,7 @@ public class CSSLayoutFlexDirectionTest {
|
||||
final CSSNode root_child2 = new CSSNode();
|
||||
root_child2.setWidth(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -119,7 +119,7 @@ public class CSSLayoutFlexDirectionTest {
|
||||
assertEquals(10f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(100f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -160,7 +160,7 @@ public class CSSLayoutFlexDirectionTest {
|
||||
final CSSNode root_child2 = new CSSNode();
|
||||
root_child2.setHeight(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -183,7 +183,7 @@ public class CSSLayoutFlexDirectionTest {
|
||||
assertEquals(100f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -210,7 +210,7 @@ public class CSSLayoutFlexDirectionTest {
|
||||
@Test
|
||||
public void test_flex_direction_row() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -225,7 +225,7 @@ public class CSSLayoutFlexDirectionTest {
|
||||
final CSSNode root_child2 = new CSSNode();
|
||||
root_child2.setWidth(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -248,7 +248,7 @@ public class CSSLayoutFlexDirectionTest {
|
||||
assertEquals(10f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(100f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -275,7 +275,7 @@ public class CSSLayoutFlexDirectionTest {
|
||||
@Test
|
||||
public void test_flex_direction_column_reverse() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.COLUMN_REVERSE);
|
||||
root.setFlexDirection(YogaFlexDirection.COLUMN_REVERSE);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -290,7 +290,7 @@ public class CSSLayoutFlexDirectionTest {
|
||||
final CSSNode root_child2 = new CSSNode();
|
||||
root_child2.setHeight(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -313,7 +313,7 @@ public class CSSLayoutFlexDirectionTest {
|
||||
assertEquals(100f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -340,7 +340,7 @@ public class CSSLayoutFlexDirectionTest {
|
||||
@Test
|
||||
public void test_flex_direction_row_reverse() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW_REVERSE);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW_REVERSE);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -355,7 +355,7 @@ public class CSSLayoutFlexDirectionTest {
|
||||
final CSSNode root_child2 = new CSSNode();
|
||||
root_child2.setWidth(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -378,7 +378,7 @@ public class CSSLayoutFlexDirectionTest {
|
||||
assertEquals(10f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(100f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
|
@@ -30,7 +30,7 @@ public class CSSLayoutFlexTest {
|
||||
final CSSNode root_child1 = new CSSNode();
|
||||
root_child1.setFlexGrow(1f);
|
||||
root.addChildAt(root_child1, 1);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -48,7 +48,7 @@ public class CSSLayoutFlexTest {
|
||||
assertEquals(100f, root_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(25f, root_child1.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -70,7 +70,7 @@ public class CSSLayoutFlexTest {
|
||||
@Test
|
||||
public void test_flex_basis_flex_grow_row() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -82,7 +82,7 @@ public class CSSLayoutFlexTest {
|
||||
final CSSNode root_child1 = new CSSNode();
|
||||
root_child1.setFlexGrow(1f);
|
||||
root.addChildAt(root_child1, 1);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -100,7 +100,7 @@ public class CSSLayoutFlexTest {
|
||||
assertEquals(25f, root_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(100f, root_child1.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -133,7 +133,7 @@ public class CSSLayoutFlexTest {
|
||||
final CSSNode root_child1 = new CSSNode();
|
||||
root_child1.setFlexBasis(50f);
|
||||
root.addChildAt(root_child1, 1);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -151,7 +151,7 @@ public class CSSLayoutFlexTest {
|
||||
assertEquals(100f, root_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(50f, root_child1.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -173,7 +173,7 @@ public class CSSLayoutFlexTest {
|
||||
@Test
|
||||
public void test_flex_basis_flex_shrink_row() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -185,7 +185,7 @@ public class CSSLayoutFlexTest {
|
||||
final CSSNode root_child1 = new CSSNode();
|
||||
root_child1.setFlexBasis(50f);
|
||||
root.addChildAt(root_child1, 1);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -203,7 +203,7 @@ public class CSSLayoutFlexTest {
|
||||
assertEquals(50f, root_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(100f, root_child1.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -242,7 +242,7 @@ public class CSSLayoutFlexTest {
|
||||
root_child2.setWidth(50f);
|
||||
root_child2.setHeight(50f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -265,7 +265,7 @@ public class CSSLayoutFlexTest {
|
||||
assertEquals(50f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(50f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -310,7 +310,7 @@ public class CSSLayoutFlexTest {
|
||||
root_child2.setFlexGrow(1f);
|
||||
root_child2.setHeight(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -333,7 +333,7 @@ public class CSSLayoutFlexTest {
|
||||
assertEquals(100f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(20f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -370,7 +370,7 @@ public class CSSLayoutFlexTest {
|
||||
root_child0_child0.setFlexGrow(1f);
|
||||
root_child0_child0.setFlexShrink(1f);
|
||||
root_child0.addChildAt(root_child0_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -388,7 +388,7 @@ public class CSSLayoutFlexTest {
|
||||
assertEquals(100f, root_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(0f, root_child0_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
|
@@ -19,7 +19,7 @@ public class CSSLayoutFlexWrapTest {
|
||||
@Test
|
||||
public void test_wrap_column() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setWrap(CSSWrap.WRAP);
|
||||
root.setWrap(YogaWrap.WRAP);
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
@@ -41,7 +41,7 @@ public class CSSLayoutFlexWrapTest {
|
||||
root_child3.setWidth(30f);
|
||||
root_child3.setHeight(30f);
|
||||
root.addChildAt(root_child3, 3);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -69,7 +69,7 @@ public class CSSLayoutFlexWrapTest {
|
||||
assertEquals(30f, root_child3.getLayoutWidth(), 0.0f);
|
||||
assertEquals(30f, root_child3.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -101,8 +101,8 @@ public class CSSLayoutFlexWrapTest {
|
||||
@Test
|
||||
public void test_wrap_row() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setWrap(CSSWrap.WRAP);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setWrap(YogaWrap.WRAP);
|
||||
root.setWidth(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
@@ -124,7 +124,7 @@ public class CSSLayoutFlexWrapTest {
|
||||
root_child3.setWidth(30f);
|
||||
root_child3.setHeight(30f);
|
||||
root.addChildAt(root_child3, 3);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -152,7 +152,7 @@ public class CSSLayoutFlexWrapTest {
|
||||
assertEquals(30f, root_child3.getLayoutWidth(), 0.0f);
|
||||
assertEquals(30f, root_child3.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -184,9 +184,9 @@ public class CSSLayoutFlexWrapTest {
|
||||
@Test
|
||||
public void test_wrap_row_align_items_flex_end() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setAlignItems(CSSAlign.FLEX_END);
|
||||
root.setWrap(CSSWrap.WRAP);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setAlignItems(YogaAlign.FLEX_END);
|
||||
root.setWrap(YogaWrap.WRAP);
|
||||
root.setWidth(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
@@ -208,7 +208,7 @@ public class CSSLayoutFlexWrapTest {
|
||||
root_child3.setWidth(30f);
|
||||
root_child3.setHeight(30f);
|
||||
root.addChildAt(root_child3, 3);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -236,7 +236,7 @@ public class CSSLayoutFlexWrapTest {
|
||||
assertEquals(30f, root_child3.getLayoutWidth(), 0.0f);
|
||||
assertEquals(30f, root_child3.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -268,9 +268,9 @@ public class CSSLayoutFlexWrapTest {
|
||||
@Test
|
||||
public void test_wrap_row_align_items_center() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setAlignItems(CSSAlign.CENTER);
|
||||
root.setWrap(CSSWrap.WRAP);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setAlignItems(YogaAlign.CENTER);
|
||||
root.setWrap(YogaWrap.WRAP);
|
||||
root.setWidth(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
@@ -292,7 +292,7 @@ public class CSSLayoutFlexWrapTest {
|
||||
root_child3.setWidth(30f);
|
||||
root_child3.setHeight(30f);
|
||||
root.addChildAt(root_child3, 3);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -320,7 +320,7 @@ public class CSSLayoutFlexWrapTest {
|
||||
assertEquals(30f, root_child3.getLayoutWidth(), 0.0f);
|
||||
assertEquals(30f, root_child3.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
|
@@ -19,7 +19,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
@Test
|
||||
public void test_justify_content_row_flex_start() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setWidth(102f);
|
||||
root.setHeight(102f);
|
||||
|
||||
@@ -34,7 +34,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
final CSSNode root_child2 = new CSSNode();
|
||||
root_child2.setWidth(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -57,7 +57,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
assertEquals(10f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(102f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -84,8 +84,8 @@ public class CSSLayoutJustifyContentTest {
|
||||
@Test
|
||||
public void test_justify_content_row_flex_end() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setJustifyContent(CSSJustify.FLEX_END);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setJustifyContent(YogaJustify.FLEX_END);
|
||||
root.setWidth(102f);
|
||||
root.setHeight(102f);
|
||||
|
||||
@@ -100,7 +100,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
final CSSNode root_child2 = new CSSNode();
|
||||
root_child2.setWidth(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -123,7 +123,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
assertEquals(10f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(102f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -150,8 +150,8 @@ public class CSSLayoutJustifyContentTest {
|
||||
@Test
|
||||
public void test_justify_content_row_center() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setJustifyContent(CSSJustify.CENTER);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setJustifyContent(YogaJustify.CENTER);
|
||||
root.setWidth(102f);
|
||||
root.setHeight(102f);
|
||||
|
||||
@@ -166,7 +166,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
final CSSNode root_child2 = new CSSNode();
|
||||
root_child2.setWidth(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -189,7 +189,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
assertEquals(10f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(102f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -216,8 +216,8 @@ public class CSSLayoutJustifyContentTest {
|
||||
@Test
|
||||
public void test_justify_content_row_space_between() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setJustifyContent(CSSJustify.SPACE_BETWEEN);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setJustifyContent(YogaJustify.SPACE_BETWEEN);
|
||||
root.setWidth(102f);
|
||||
root.setHeight(102f);
|
||||
|
||||
@@ -232,7 +232,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
final CSSNode root_child2 = new CSSNode();
|
||||
root_child2.setWidth(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -255,7 +255,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
assertEquals(10f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(102f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -282,8 +282,8 @@ public class CSSLayoutJustifyContentTest {
|
||||
@Test
|
||||
public void test_justify_content_row_space_around() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setJustifyContent(CSSJustify.SPACE_AROUND);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setJustifyContent(YogaJustify.SPACE_AROUND);
|
||||
root.setWidth(102f);
|
||||
root.setHeight(102f);
|
||||
|
||||
@@ -298,7 +298,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
final CSSNode root_child2 = new CSSNode();
|
||||
root_child2.setWidth(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -321,7 +321,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
assertEquals(10f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(102f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -361,7 +361,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
final CSSNode root_child2 = new CSSNode();
|
||||
root_child2.setHeight(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -384,7 +384,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
assertEquals(102f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -411,7 +411,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
@Test
|
||||
public void test_justify_content_column_flex_end() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setJustifyContent(CSSJustify.FLEX_END);
|
||||
root.setJustifyContent(YogaJustify.FLEX_END);
|
||||
root.setWidth(102f);
|
||||
root.setHeight(102f);
|
||||
|
||||
@@ -426,7 +426,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
final CSSNode root_child2 = new CSSNode();
|
||||
root_child2.setHeight(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -449,7 +449,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
assertEquals(102f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -476,7 +476,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
@Test
|
||||
public void test_justify_content_column_center() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setJustifyContent(CSSJustify.CENTER);
|
||||
root.setJustifyContent(YogaJustify.CENTER);
|
||||
root.setWidth(102f);
|
||||
root.setHeight(102f);
|
||||
|
||||
@@ -491,7 +491,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
final CSSNode root_child2 = new CSSNode();
|
||||
root_child2.setHeight(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -514,7 +514,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
assertEquals(102f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -541,7 +541,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
@Test
|
||||
public void test_justify_content_column_space_between() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setJustifyContent(CSSJustify.SPACE_BETWEEN);
|
||||
root.setJustifyContent(YogaJustify.SPACE_BETWEEN);
|
||||
root.setWidth(102f);
|
||||
root.setHeight(102f);
|
||||
|
||||
@@ -556,7 +556,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
final CSSNode root_child2 = new CSSNode();
|
||||
root_child2.setHeight(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -579,7 +579,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
assertEquals(102f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -606,7 +606,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
@Test
|
||||
public void test_justify_content_column_space_around() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setJustifyContent(CSSJustify.SPACE_AROUND);
|
||||
root.setJustifyContent(YogaJustify.SPACE_AROUND);
|
||||
root.setWidth(102f);
|
||||
root.setHeight(102f);
|
||||
|
||||
@@ -621,7 +621,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
final CSSNode root_child2 = new CSSNode();
|
||||
root_child2.setHeight(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -644,7 +644,7 @@ public class CSSLayoutJustifyContentTest {
|
||||
assertEquals(102f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
|
@@ -19,15 +19,15 @@ public class CSSLayoutMarginTest {
|
||||
@Test
|
||||
public void test_margin_start() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setMargin(CSSEdge.START, 10f);
|
||||
root_child0.setMargin(YogaEdge.START, 10f);
|
||||
root_child0.setWidth(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -40,7 +40,7 @@ public class CSSLayoutMarginTest {
|
||||
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(100f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -61,10 +61,10 @@ public class CSSLayoutMarginTest {
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setMargin(CSSEdge.TOP, 10f);
|
||||
root_child0.setMargin(YogaEdge.TOP, 10f);
|
||||
root_child0.setHeight(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -77,7 +77,7 @@ public class CSSLayoutMarginTest {
|
||||
assertEquals(100f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -94,16 +94,16 @@ public class CSSLayoutMarginTest {
|
||||
@Test
|
||||
public void test_margin_end() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setJustifyContent(CSSJustify.FLEX_END);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setJustifyContent(YogaJustify.FLEX_END);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setMargin(CSSEdge.END, 10f);
|
||||
root_child0.setMargin(YogaEdge.END, 10f);
|
||||
root_child0.setWidth(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -116,7 +116,7 @@ public class CSSLayoutMarginTest {
|
||||
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(100f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -133,15 +133,15 @@ public class CSSLayoutMarginTest {
|
||||
@Test
|
||||
public void test_margin_bottom() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setJustifyContent(CSSJustify.FLEX_END);
|
||||
root.setJustifyContent(YogaJustify.FLEX_END);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setMargin(CSSEdge.BOTTOM, 10f);
|
||||
root_child0.setMargin(YogaEdge.BOTTOM, 10f);
|
||||
root_child0.setHeight(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -154,7 +154,7 @@ public class CSSLayoutMarginTest {
|
||||
assertEquals(100f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -171,15 +171,15 @@ public class CSSLayoutMarginTest {
|
||||
@Test
|
||||
public void test_margin_and_flex_row() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setFlexGrow(1f);
|
||||
root_child0.setMargin(CSSEdge.START, 10f);
|
||||
root_child0.setMargin(YogaEdge.START, 10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -192,7 +192,7 @@ public class CSSLayoutMarginTest {
|
||||
assertEquals(90f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(100f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -214,9 +214,9 @@ public class CSSLayoutMarginTest {
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setFlexGrow(1f);
|
||||
root_child0.setMargin(CSSEdge.TOP, 10f);
|
||||
root_child0.setMargin(YogaEdge.TOP, 10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -229,7 +229,7 @@ public class CSSLayoutMarginTest {
|
||||
assertEquals(100f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(90f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -246,15 +246,15 @@ public class CSSLayoutMarginTest {
|
||||
@Test
|
||||
public void test_margin_and_stretch_row() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setFlexGrow(1f);
|
||||
root_child0.setMargin(CSSEdge.TOP, 10f);
|
||||
root_child0.setMargin(YogaEdge.TOP, 10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -267,7 +267,7 @@ public class CSSLayoutMarginTest {
|
||||
assertEquals(100f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(90f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -289,9 +289,9 @@ public class CSSLayoutMarginTest {
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setFlexGrow(1f);
|
||||
root_child0.setMargin(CSSEdge.START, 10f);
|
||||
root_child0.setMargin(YogaEdge.START, 10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -304,7 +304,7 @@ public class CSSLayoutMarginTest {
|
||||
assertEquals(90f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(100f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -321,7 +321,7 @@ public class CSSLayoutMarginTest {
|
||||
@Test
|
||||
public void test_margin_with_sibling_row() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -332,7 +332,7 @@ public class CSSLayoutMarginTest {
|
||||
final CSSNode root_child1 = new CSSNode();
|
||||
root_child1.setFlexGrow(1f);
|
||||
root.addChildAt(root_child1, 1);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -350,7 +350,7 @@ public class CSSLayoutMarginTest {
|
||||
assertEquals(50f, root_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(100f, root_child1.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -382,7 +382,7 @@ public class CSSLayoutMarginTest {
|
||||
final CSSNode root_child1 = new CSSNode();
|
||||
root_child1.setFlexGrow(1f);
|
||||
root.addChildAt(root_child1, 1);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -400,7 +400,7 @@ public class CSSLayoutMarginTest {
|
||||
assertEquals(100f, root_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(50f, root_child1.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
|
@@ -26,7 +26,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
root_child0.setMaxWidth(50f);
|
||||
root_child0.setHeight(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -39,7 +39,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
assertEquals(50f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -56,7 +56,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
@Test
|
||||
public void test_max_height() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -64,7 +64,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
root_child0.setWidth(10f);
|
||||
root_child0.setMaxHeight(50f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -77,7 +77,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(50f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -105,7 +105,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
final CSSNode root_child1 = new CSSNode();
|
||||
root_child1.setFlexGrow(1f);
|
||||
root.addChildAt(root_child1, 1);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -123,7 +123,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
assertEquals(100f, root_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(20f, root_child1.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -145,7 +145,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
@Test
|
||||
public void test_min_width() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -157,7 +157,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
final CSSNode root_child1 = new CSSNode();
|
||||
root_child1.setFlexGrow(1f);
|
||||
root.addChildAt(root_child1, 1);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -175,7 +175,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
assertEquals(20f, root_child1.getLayoutWidth(), 0.0f);
|
||||
assertEquals(100f, root_child1.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -197,7 +197,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
@Test
|
||||
public void test_justify_content_min_max() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setJustifyContent(CSSJustify.CENTER);
|
||||
root.setJustifyContent(YogaJustify.CENTER);
|
||||
root.setWidth(100f);
|
||||
root.setMinHeight(100f);
|
||||
root.setMaxHeight(200f);
|
||||
@@ -206,7 +206,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
root_child0.setWidth(60f);
|
||||
root_child0.setHeight(60f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -219,7 +219,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
assertEquals(60f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(60f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -236,7 +236,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
@Test
|
||||
public void test_align_items_min_max() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setAlignItems(CSSAlign.CENTER);
|
||||
root.setAlignItems(YogaAlign.CENTER);
|
||||
root.setMinWidth(100f);
|
||||
root.setMaxWidth(200f);
|
||||
root.setHeight(100f);
|
||||
@@ -245,7 +245,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
root_child0.setWidth(60f);
|
||||
root_child0.setHeight(60f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -258,7 +258,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
assertEquals(60f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(60f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -275,7 +275,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
@Test
|
||||
public void test_justify_content_overflow_min_max() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setJustifyContent(CSSJustify.CENTER);
|
||||
root.setJustifyContent(YogaJustify.CENTER);
|
||||
root.setMinHeight(100f);
|
||||
root.setMaxHeight(110f);
|
||||
|
||||
@@ -293,7 +293,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
root_child2.setWidth(50f);
|
||||
root_child2.setHeight(50f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -316,7 +316,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
assertEquals(50f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(50f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -347,7 +347,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root_child0.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root_child0.setMaxWidth(100f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
|
||||
@@ -355,7 +355,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
root_child0_child0.setFlexGrow(1f);
|
||||
root_child0_child0.setHeight(20f);
|
||||
root_child0.addChildAt(root_child0_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -373,7 +373,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
assertEquals(100f, root_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(20f, root_child0_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -399,7 +399,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root_child0.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root_child0.setMaxWidth(300f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
|
||||
@@ -407,7 +407,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
root_child0_child0.setFlexGrow(1f);
|
||||
root_child0_child0.setHeight(20f);
|
||||
root_child0.addChildAt(root_child0_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -425,7 +425,7 @@ public class CSSLayoutMinMaxDimensionTest {
|
||||
assertEquals(200f, root_child0_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(20f, root_child0_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
|
@@ -19,11 +19,11 @@ public class CSSLayoutPaddingTest {
|
||||
@Test
|
||||
public void test_padding_no_size() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setPadding(CSSEdge.LEFT, 10);
|
||||
root.setPadding(CSSEdge.TOP, 10);
|
||||
root.setPadding(CSSEdge.RIGHT, 10);
|
||||
root.setPadding(CSSEdge.BOTTOM, 10);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setPadding(YogaEdge.LEFT, 10);
|
||||
root.setPadding(YogaEdge.TOP, 10);
|
||||
root.setPadding(YogaEdge.RIGHT, 10);
|
||||
root.setPadding(YogaEdge.BOTTOM, 10);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -31,7 +31,7 @@ public class CSSLayoutPaddingTest {
|
||||
assertEquals(20f, root.getLayoutWidth(), 0.0f);
|
||||
assertEquals(20f, root.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -43,16 +43,16 @@ public class CSSLayoutPaddingTest {
|
||||
@Test
|
||||
public void test_padding_container_match_child() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setPadding(CSSEdge.LEFT, 10);
|
||||
root.setPadding(CSSEdge.TOP, 10);
|
||||
root.setPadding(CSSEdge.RIGHT, 10);
|
||||
root.setPadding(CSSEdge.BOTTOM, 10);
|
||||
root.setPadding(YogaEdge.LEFT, 10);
|
||||
root.setPadding(YogaEdge.TOP, 10);
|
||||
root.setPadding(YogaEdge.RIGHT, 10);
|
||||
root.setPadding(YogaEdge.BOTTOM, 10);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setWidth(10f);
|
||||
root_child0.setHeight(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -65,7 +65,7 @@ public class CSSLayoutPaddingTest {
|
||||
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -82,10 +82,10 @@ public class CSSLayoutPaddingTest {
|
||||
@Test
|
||||
public void test_padding_flex_child() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setPadding(CSSEdge.LEFT, 10);
|
||||
root.setPadding(CSSEdge.TOP, 10);
|
||||
root.setPadding(CSSEdge.RIGHT, 10);
|
||||
root.setPadding(CSSEdge.BOTTOM, 10);
|
||||
root.setPadding(YogaEdge.LEFT, 10);
|
||||
root.setPadding(YogaEdge.TOP, 10);
|
||||
root.setPadding(YogaEdge.RIGHT, 10);
|
||||
root.setPadding(YogaEdge.BOTTOM, 10);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -93,7 +93,7 @@ public class CSSLayoutPaddingTest {
|
||||
root_child0.setFlexGrow(1f);
|
||||
root_child0.setWidth(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -106,7 +106,7 @@ public class CSSLayoutPaddingTest {
|
||||
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(80f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -123,17 +123,17 @@ public class CSSLayoutPaddingTest {
|
||||
@Test
|
||||
public void test_padding_stretch_child() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setPadding(CSSEdge.LEFT, 10);
|
||||
root.setPadding(CSSEdge.TOP, 10);
|
||||
root.setPadding(CSSEdge.RIGHT, 10);
|
||||
root.setPadding(CSSEdge.BOTTOM, 10);
|
||||
root.setPadding(YogaEdge.LEFT, 10);
|
||||
root.setPadding(YogaEdge.TOP, 10);
|
||||
root.setPadding(YogaEdge.RIGHT, 10);
|
||||
root.setPadding(YogaEdge.BOTTOM, 10);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setHeight(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -146,7 +146,7 @@ public class CSSLayoutPaddingTest {
|
||||
assertEquals(80f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -163,11 +163,11 @@ public class CSSLayoutPaddingTest {
|
||||
@Test
|
||||
public void test_padding_center_child() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setJustifyContent(CSSJustify.CENTER);
|
||||
root.setAlignItems(CSSAlign.CENTER);
|
||||
root.setPadding(CSSEdge.START, 10);
|
||||
root.setPadding(CSSEdge.END, 20);
|
||||
root.setPadding(CSSEdge.BOTTOM, 20);
|
||||
root.setJustifyContent(YogaJustify.CENTER);
|
||||
root.setAlignItems(YogaAlign.CENTER);
|
||||
root.setPadding(YogaEdge.START, 10);
|
||||
root.setPadding(YogaEdge.END, 20);
|
||||
root.setPadding(YogaEdge.BOTTOM, 20);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -175,7 +175,7 @@ public class CSSLayoutPaddingTest {
|
||||
root_child0.setWidth(10f);
|
||||
root_child0.setHeight(10f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -188,7 +188,7 @@ public class CSSLayoutPaddingTest {
|
||||
assertEquals(10f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(10f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -205,20 +205,20 @@ public class CSSLayoutPaddingTest {
|
||||
@Test
|
||||
public void test_child_with_padding_align_end() {
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setJustifyContent(CSSJustify.FLEX_END);
|
||||
root.setAlignItems(CSSAlign.FLEX_END);
|
||||
root.setJustifyContent(YogaJustify.FLEX_END);
|
||||
root.setAlignItems(YogaAlign.FLEX_END);
|
||||
root.setWidth(200f);
|
||||
root.setHeight(200f);
|
||||
|
||||
final CSSNode root_child0 = new CSSNode();
|
||||
root_child0.setPadding(CSSEdge.LEFT, 20);
|
||||
root_child0.setPadding(CSSEdge.TOP, 20);
|
||||
root_child0.setPadding(CSSEdge.RIGHT, 20);
|
||||
root_child0.setPadding(CSSEdge.BOTTOM, 20);
|
||||
root_child0.setPadding(YogaEdge.LEFT, 20);
|
||||
root_child0.setPadding(YogaEdge.TOP, 20);
|
||||
root_child0.setPadding(YogaEdge.RIGHT, 20);
|
||||
root_child0.setPadding(YogaEdge.BOTTOM, 20);
|
||||
root_child0.setWidth(100f);
|
||||
root_child0.setHeight(100f);
|
||||
root.addChildAt(root_child0, 0);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -231,7 +231,7 @@ public class CSSLayoutPaddingTest {
|
||||
assertEquals(100f, root_child0.getLayoutWidth(), 0.0f);
|
||||
assertEquals(100f, root_child0.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
|
@@ -18,10 +18,10 @@ import static org.junit.Assert.assertEquals;
|
||||
public class CSSLayoutRoundingTest {
|
||||
@Test
|
||||
public void test_rounding_flex_basis_flex_grow_row_width_of_100() {
|
||||
CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.ROUNDING, true);
|
||||
CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true);
|
||||
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -36,7 +36,7 @@ public class CSSLayoutRoundingTest {
|
||||
final CSSNode root_child2 = new CSSNode();
|
||||
root_child2.setFlexGrow(1f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -59,7 +59,7 @@ public class CSSLayoutRoundingTest {
|
||||
assertEquals(33f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(100f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -82,15 +82,15 @@ public class CSSLayoutRoundingTest {
|
||||
assertEquals(33f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(100f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.ROUNDING, false);
|
||||
CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_rounding_flex_basis_flex_grow_row_prime_number_width() {
|
||||
CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.ROUNDING, true);
|
||||
CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true);
|
||||
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setWidth(113f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -113,7 +113,7 @@ public class CSSLayoutRoundingTest {
|
||||
final CSSNode root_child4 = new CSSNode();
|
||||
root_child4.setFlexGrow(1f);
|
||||
root.addChildAt(root_child4, 4);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -146,7 +146,7 @@ public class CSSLayoutRoundingTest {
|
||||
assertEquals(23f, root_child4.getLayoutWidth(), 0.0f);
|
||||
assertEquals(100f, root_child4.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -179,15 +179,15 @@ public class CSSLayoutRoundingTest {
|
||||
assertEquals(23f, root_child4.getLayoutWidth(), 0.0f);
|
||||
assertEquals(100f, root_child4.getLayoutHeight(), 0.0f);
|
||||
|
||||
CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.ROUNDING, false);
|
||||
CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_rounding_flex_basis_flex_shrink_row() {
|
||||
CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.ROUNDING, true);
|
||||
CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true);
|
||||
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setFlexDirection(CSSFlexDirection.ROW);
|
||||
root.setFlexDirection(YogaFlexDirection.ROW);
|
||||
root.setWidth(101f);
|
||||
root.setHeight(100f);
|
||||
|
||||
@@ -203,7 +203,7 @@ public class CSSLayoutRoundingTest {
|
||||
final CSSNode root_child2 = new CSSNode();
|
||||
root_child2.setFlexBasis(25f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -226,7 +226,7 @@ public class CSSLayoutRoundingTest {
|
||||
assertEquals(25f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(100f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -249,12 +249,12 @@ public class CSSLayoutRoundingTest {
|
||||
assertEquals(25f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(100f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.ROUNDING, false);
|
||||
CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_rounding_flex_basis_overrides_main_size() {
|
||||
CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.ROUNDING, true);
|
||||
CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true);
|
||||
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setWidth(100f);
|
||||
@@ -275,7 +275,7 @@ public class CSSLayoutRoundingTest {
|
||||
root_child2.setFlexGrow(1f);
|
||||
root_child2.setHeight(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -298,7 +298,7 @@ public class CSSLayoutRoundingTest {
|
||||
assertEquals(100f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(24f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -321,12 +321,12 @@ public class CSSLayoutRoundingTest {
|
||||
assertEquals(100f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(24f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.ROUNDING, false);
|
||||
CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_rounding_total_fractial() {
|
||||
CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.ROUNDING, true);
|
||||
CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true);
|
||||
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setWidth(87.4f);
|
||||
@@ -347,7 +347,7 @@ public class CSSLayoutRoundingTest {
|
||||
root_child2.setFlexGrow(1.1f);
|
||||
root_child2.setHeight(10.7f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -370,7 +370,7 @@ public class CSSLayoutRoundingTest {
|
||||
assertEquals(87f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(24f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -393,12 +393,12 @@ public class CSSLayoutRoundingTest {
|
||||
assertEquals(87f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(24f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.ROUNDING, false);
|
||||
CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_rounding_total_fractial_nested() {
|
||||
CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.ROUNDING, true);
|
||||
CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true);
|
||||
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setWidth(87.4f);
|
||||
@@ -413,14 +413,14 @@ public class CSSLayoutRoundingTest {
|
||||
final CSSNode root_child0_child0 = new CSSNode();
|
||||
root_child0_child0.setFlexGrow(1f);
|
||||
root_child0_child0.setFlexBasis(0.3f);
|
||||
root_child0_child0.setPosition(CSSEdge.BOTTOM, 13.3f);
|
||||
root_child0_child0.setPosition(YogaEdge.BOTTOM, 13.3f);
|
||||
root_child0_child0.setHeight(9.9f);
|
||||
root_child0.addChildAt(root_child0_child0, 0);
|
||||
|
||||
final CSSNode root_child0_child1 = new CSSNode();
|
||||
root_child0_child1.setFlexGrow(4f);
|
||||
root_child0_child1.setFlexBasis(0.3f);
|
||||
root_child0_child1.setPosition(CSSEdge.TOP, 13.3f);
|
||||
root_child0_child1.setPosition(YogaEdge.TOP, 13.3f);
|
||||
root_child0_child1.setHeight(1.1f);
|
||||
root_child0.addChildAt(root_child0_child1, 1);
|
||||
|
||||
@@ -433,7 +433,7 @@ public class CSSLayoutRoundingTest {
|
||||
root_child2.setFlexGrow(1.1f);
|
||||
root_child2.setHeight(10.7f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -466,7 +466,7 @@ public class CSSLayoutRoundingTest {
|
||||
assertEquals(87f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(24f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -499,12 +499,12 @@ public class CSSLayoutRoundingTest {
|
||||
assertEquals(87f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(24f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.ROUNDING, false);
|
||||
CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_rounding_fractial_input_1() {
|
||||
CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.ROUNDING, true);
|
||||
CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true);
|
||||
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setWidth(100f);
|
||||
@@ -525,7 +525,7 @@ public class CSSLayoutRoundingTest {
|
||||
root_child2.setFlexGrow(1f);
|
||||
root_child2.setHeight(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -548,7 +548,7 @@ public class CSSLayoutRoundingTest {
|
||||
assertEquals(100f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(24f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -571,12 +571,12 @@ public class CSSLayoutRoundingTest {
|
||||
assertEquals(100f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(24f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.ROUNDING, false);
|
||||
CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_rounding_fractial_input_2() {
|
||||
CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.ROUNDING, true);
|
||||
CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true);
|
||||
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setWidth(100f);
|
||||
@@ -597,7 +597,7 @@ public class CSSLayoutRoundingTest {
|
||||
root_child2.setFlexGrow(1f);
|
||||
root_child2.setHeight(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -620,7 +620,7 @@ public class CSSLayoutRoundingTest {
|
||||
assertEquals(100f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(25f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -643,15 +643,15 @@ public class CSSLayoutRoundingTest {
|
||||
assertEquals(100f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(25f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.ROUNDING, false);
|
||||
CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_rounding_fractial_input_3() {
|
||||
CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.ROUNDING, true);
|
||||
CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true);
|
||||
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setPosition(CSSEdge.TOP, 0.3f);
|
||||
root.setPosition(YogaEdge.TOP, 0.3f);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(113.4f);
|
||||
|
||||
@@ -670,7 +670,7 @@ public class CSSLayoutRoundingTest {
|
||||
root_child2.setFlexGrow(1f);
|
||||
root_child2.setHeight(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -693,7 +693,7 @@ public class CSSLayoutRoundingTest {
|
||||
assertEquals(100f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(24f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -716,15 +716,15 @@ public class CSSLayoutRoundingTest {
|
||||
assertEquals(100f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(24f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.ROUNDING, false);
|
||||
CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_rounding_fractial_input_4() {
|
||||
CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.ROUNDING, true);
|
||||
CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, true);
|
||||
|
||||
final CSSNode root = new CSSNode();
|
||||
root.setPosition(CSSEdge.TOP, 0.7f);
|
||||
root.setPosition(YogaEdge.TOP, 0.7f);
|
||||
root.setWidth(100f);
|
||||
root.setHeight(113.4f);
|
||||
|
||||
@@ -743,7 +743,7 @@ public class CSSLayoutRoundingTest {
|
||||
root_child2.setFlexGrow(1f);
|
||||
root_child2.setHeight(10f);
|
||||
root.addChildAt(root_child2, 2);
|
||||
root.setDirection(CSSDirection.LTR);
|
||||
root.setDirection(YogaDirection.LTR);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -766,7 +766,7 @@ public class CSSLayoutRoundingTest {
|
||||
assertEquals(100f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(24f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
root.setDirection(CSSDirection.RTL);
|
||||
root.setDirection(YogaDirection.RTL);
|
||||
root.calculateLayout();
|
||||
|
||||
assertEquals(0f, root.getLayoutX(), 0.0f);
|
||||
@@ -789,7 +789,7 @@ public class CSSLayoutRoundingTest {
|
||||
assertEquals(100f, root_child2.getLayoutWidth(), 0.0f);
|
||||
assertEquals(24f, root_child2.getLayoutHeight(), 0.0f);
|
||||
|
||||
CSSNode.setExperimentalFeatureEnabled(CSSExperimentalFeature.ROUNDING, false);
|
||||
CSSNode.setExperimentalFeatureEnabled(YogaExperimentalFeature.ROUNDING, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -30,9 +30,9 @@ public class CSSNodeTest {
|
||||
public long measure(
|
||||
CSSNodeAPI node,
|
||||
float width,
|
||||
CSSMeasureMode widthMode,
|
||||
YogaMeasureMode widthMode,
|
||||
float height,
|
||||
CSSMeasureMode heightMode) {
|
||||
YogaMeasureMode heightMode) {
|
||||
return MeasureOutput.make(100, 100);
|
||||
}
|
||||
});
|
||||
@@ -41,42 +41,42 @@ public class CSSNodeTest {
|
||||
assertEquals(100, (int) node.getLayoutHeight());
|
||||
}
|
||||
|
||||
private CSSLogLevel mLogLevel;
|
||||
private YogaLogLevel mLogLevel;
|
||||
private String mLogMessage;
|
||||
|
||||
@Test
|
||||
public void testLogger() {
|
||||
CSSNode.setLogger(new CSSLogger() {
|
||||
public void log(CSSLogLevel level, String message) {
|
||||
public void log(YogaLogLevel level, String message) {
|
||||
mLogLevel = level;
|
||||
mLogMessage = message;
|
||||
}
|
||||
});
|
||||
CSSNode.jni_CSSLog(CSSLogLevel.DEBUG.intValue(), "Hello");
|
||||
assertEquals(CSSLogLevel.DEBUG, mLogLevel);
|
||||
CSSNode.jni_CSSLog(YogaLogLevel.DEBUG.intValue(), "Hello");
|
||||
assertEquals(YogaLogLevel.DEBUG, mLogLevel);
|
||||
assertEquals("Hello", mLogMessage);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdateLogger() {
|
||||
CSSNode.setLogger(new CSSLogger() {
|
||||
public void log(CSSLogLevel level, String message) {}
|
||||
public void log(YogaLogLevel level, String message) {}
|
||||
});
|
||||
CSSNode.setLogger(new CSSLogger() {
|
||||
public void log(CSSLogLevel level, String message) {
|
||||
public void log(YogaLogLevel level, String message) {
|
||||
mLogLevel = level;
|
||||
mLogMessage = message;
|
||||
}
|
||||
});
|
||||
CSSNode.jni_CSSLog(CSSLogLevel.VERBOSE.intValue(), "Flexbox");
|
||||
assertEquals(CSSLogLevel.VERBOSE, mLogLevel);
|
||||
CSSNode.jni_CSSLog(YogaLogLevel.VERBOSE.intValue(), "Flexbox");
|
||||
assertEquals(YogaLogLevel.VERBOSE, mLogLevel);
|
||||
assertEquals("Flexbox", mLogMessage);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCopyStyle() {
|
||||
final CSSNode node0 = new CSSNode();
|
||||
assertTrue(CSSConstants.isUndefined(node0.getMaxHeight()));
|
||||
assertTrue(YogaConstants.isUndefined(node0.getMaxHeight()));
|
||||
|
||||
final CSSNode node1 = new CSSNode();
|
||||
node1.setMaxHeight(100);
|
||||
|
Reference in New Issue
Block a user