Provide RTL support for RCTShadowView according to new csslayout

Summary:
@public The make current RCTShadowView support RTL layout.
1 Change all left/right to start/end for margin, padding, boarder and position
2 Calculate position in the same way as margin, padding and boarder

Reviewed By: fkgozali

Differential Revision: D3619292

fbshipit-source-id: eaaa6faeee93c964d59bb6f498d89effc09ed567
This commit is contained in:
Mengjue Wang
2016-07-29 10:30:34 -07:00
committed by Facebook Github Bot 6
parent 5e7d95b403
commit 5207b90420
2 changed files with 65 additions and 73 deletions

View File

@@ -378,11 +378,11 @@ public class CSSNode {
/**
* Get this node's position, as defined by style.
*/
public Spacing getPosition() {
public Spacing getPositionValue() {
return style.position;
}
public void setPosition(int spacingType, float position) {
public void setPositionValue(int spacingType, float position) {
if (style.position.set(spacingType, position)) {
dirty();
}
@@ -396,9 +396,7 @@ public class CSSNode {
}
public void setPositionTop(float positionTop) {
if (style.position.set(TOP, positionTop)) {
dirty();
}
setPositionValue(TOP, positionTop);
}
/**
@@ -409,9 +407,7 @@ public class CSSNode {
}
public void setPositionBottom(float positionBottom) {
if (style.position.set(BOTTOM, positionBottom)) {
dirty();
}
setPositionValue(BOTTOM, positionBottom);
}
/**
@@ -422,9 +418,7 @@ public class CSSNode {
}
public void setPositionLeft(float positionLeft) {
if (style.position.set(LEFT, positionLeft)) {
dirty();
}
setPositionValue(LEFT, positionLeft);
}
/**
@@ -435,9 +429,7 @@ public class CSSNode {
}
public void setPositionRight(float positionRight) {
if (style.position.set(RIGHT, positionRight)) {
dirty();
}
setPositionValue(RIGHT, positionRight);
}
/**