Fix checks for already set padding
Reviewed By: ahmedre Differential Revision: D4393371 fbshipit-source-id: 96672d0ee38b16b6f225c8a6fe0442c9b9eb9ec8
This commit is contained in:
parent
a1d77af07c
commit
9724eaeb42
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue