Fix checks for already set padding

Reviewed By: ahmedre

Differential Revision: D4393371

fbshipit-source-id: 96672d0ee38b16b6f225c8a6fe0442c9b9eb9ec8
This commit is contained in:
Emil Sjolander 2017-01-10 02:21:50 -08:00 committed by Facebook Github Bot
parent a1d77af07c
commit 9724eaeb42
4 changed files with 7 additions and 3 deletions

View File

@ -104,7 +104,7 @@ import com.facebook.react.views.art.ARTVirtualNode;
@Override
public void setPadding(int spacingType, float padding) {
if (getPadding(spacingType) != padding) {
if (getStylePadding(spacingType) != padding) {
super.setPadding(spacingType, padding);
mPaddingChanged = true;
markUpdated();

View File

@ -86,7 +86,7 @@ class FlatReactModalShadowNode extends FlatShadowNode implements AndroidView {
@Override
public void setPadding(int spacingType, float padding) {
if (getPadding(spacingType) != padding) {
if (getStylePadding(spacingType) != padding) {
super.setPadding(spacingType, padding);
mPaddingChanged = true;
markUpdated();

View File

@ -101,7 +101,7 @@ import com.facebook.react.uimanager.ViewManager;
@Override
public void setPadding(int spacingType, float padding) {
if (getPadding(spacingType) != padding) {
if (getStylePadding(spacingType) != padding) {
super.setPadding(spacingType, padding);
mPaddingChanged = true;
markUpdated();

View File

@ -598,6 +598,10 @@ public class ReactShadowNode {
return mYogaNode.getLayoutPadding(YogaEdge.fromInt(spacingType));
}
public final float getStylePadding(int spacingType) {
return mYogaNode.getPadding(YogaEdge.fromInt(spacingType)).value;
}
public void setDefaultPadding(int spacingType, float padding) {
mDefaultPadding.set(spacingType, padding);
updatePadding();