Add getters for all style properties
For consistency and because now we have some use cases for it.
This commit is contained in:
@@ -228,6 +228,13 @@ public class CSSNode {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this node's flex direction, as defined by style.
|
||||
*/
|
||||
public CSSFlexDirection getFlexDirection() {
|
||||
return style.flexDirection;
|
||||
}
|
||||
|
||||
public void setFlexDirection(CSSFlexDirection flexDirection) {
|
||||
if (style.flexDirection != flexDirection) {
|
||||
style.flexDirection = flexDirection;
|
||||
@@ -235,6 +242,13 @@ public class CSSNode {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this node's justify content, as defined by style.
|
||||
*/
|
||||
public CSSJustify getJustifyContent() {
|
||||
return style.justifyContent;
|
||||
}
|
||||
|
||||
public void setJustifyContent(CSSJustify justifyContent) {
|
||||
if (style.justifyContent != justifyContent) {
|
||||
style.justifyContent = justifyContent;
|
||||
@@ -242,6 +256,13 @@ public class CSSNode {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this node's align items, as defined by style.
|
||||
*/
|
||||
public CSSAlign getAlignItems() {
|
||||
return style.alignItems;
|
||||
}
|
||||
|
||||
public void setAlignItems(CSSAlign alignItems) {
|
||||
if (style.alignItems != alignItems) {
|
||||
style.alignItems = alignItems;
|
||||
@@ -249,6 +270,13 @@ public class CSSNode {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this node's align items, as defined by style.
|
||||
*/
|
||||
public CSSAlign getAlignSelf() {
|
||||
return style.alignSelf;
|
||||
}
|
||||
|
||||
public void setAlignSelf(CSSAlign alignSelf) {
|
||||
if (style.alignSelf != alignSelf) {
|
||||
style.alignSelf = alignSelf;
|
||||
@@ -256,6 +284,13 @@ public class CSSNode {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this node's position type, as defined by style.
|
||||
*/
|
||||
public CSSPositionType getPositionType() {
|
||||
return style.positionType;
|
||||
}
|
||||
|
||||
public void setPositionType(CSSPositionType positionType) {
|
||||
if (style.positionType != positionType) {
|
||||
style.positionType = positionType;
|
||||
@@ -270,6 +305,13 @@ public class CSSNode {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this node's flex, as defined by style.
|
||||
*/
|
||||
public float getFlex() {
|
||||
return style.flex;
|
||||
}
|
||||
|
||||
public void setFlex(float flex) {
|
||||
if (!valuesEqual(style.flex, flex)) {
|
||||
style.flex = flex;
|
||||
@@ -277,6 +319,13 @@ public class CSSNode {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this node's margin, as defined by style + default margin.
|
||||
*/
|
||||
public Spacing getMargin() {
|
||||
return style.margin;
|
||||
}
|
||||
|
||||
public void setMargin(int spacingType, float margin) {
|
||||
if (style.margin.set(spacingType, margin)) {
|
||||
dirty();
|
||||
@@ -289,12 +338,26 @@ public class CSSNode {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this node's border, as defined by style.
|
||||
*/
|
||||
public Spacing getBorder() {
|
||||
return style.border;
|
||||
}
|
||||
|
||||
public void setBorder(int spacingType, float border) {
|
||||
if (style.border.set(spacingType, border)) {
|
||||
dirty();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this node's position top, as defined by style.
|
||||
*/
|
||||
public float getPositionTop() {
|
||||
return style.position[POSITION_TOP];
|
||||
}
|
||||
|
||||
public void setPositionTop(float positionTop) {
|
||||
if (!valuesEqual(style.position[POSITION_TOP], positionTop)) {
|
||||
style.position[POSITION_TOP] = positionTop;
|
||||
@@ -302,6 +365,13 @@ public class CSSNode {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this node's position bottom, as defined by style.
|
||||
*/
|
||||
public float getPositionBottom() {
|
||||
return style.position[POSITION_BOTTOM];
|
||||
}
|
||||
|
||||
public void setPositionBottom(float positionBottom) {
|
||||
if (!valuesEqual(style.position[POSITION_BOTTOM], positionBottom)) {
|
||||
style.position[POSITION_BOTTOM] = positionBottom;
|
||||
@@ -309,6 +379,13 @@ public class CSSNode {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this node's position left, as defined by style.
|
||||
*/
|
||||
public float getPositionLeft() {
|
||||
return style.position[POSITION_LEFT];
|
||||
}
|
||||
|
||||
public void setPositionLeft(float positionLeft) {
|
||||
if (!valuesEqual(style.position[POSITION_LEFT], positionLeft)) {
|
||||
style.position[POSITION_LEFT] = positionLeft;
|
||||
@@ -316,6 +393,13 @@ public class CSSNode {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this node's position right, as defined by style.
|
||||
*/
|
||||
public float getPositionRight() {
|
||||
return style.position[POSITION_RIGHT];
|
||||
}
|
||||
|
||||
public void setPositionRight(float positionRight) {
|
||||
if (!valuesEqual(style.position[POSITION_RIGHT], positionRight)) {
|
||||
style.position[POSITION_RIGHT] = positionRight;
|
||||
|
Reference in New Issue
Block a user