Dont create a spacing object for returning margin, padding, border, and position

Summary: The current implementation was made out of simplicity and to keep the same API as before. Now that the java version of csslayout is deprecated it is time to change the API to make the calls more efficient for the JNI version. This diff with reduce allocations as well as reduce the number of JNI calls done.

Differential Revision: D4050773
This commit is contained in:
Emil Sjolander
2016-10-24 10:35:43 -07:00
committed by Ahmed El-Helw
parent e909fc01c0
commit c10bbe5599
7 changed files with 27 additions and 22 deletions

View File

@@ -102,7 +102,8 @@ import com.facebook.react.uimanager.ViewManager;
@Override
public void setPadding(int spacingType, float padding) {
if (getPadding().set(spacingType, padding)) {
if (getPadding(spacingType) != padding) {
setPadding(spacingType, padding);
mPaddingChanged = true;
dirty();
}