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

@@ -9,8 +9,6 @@
package com.facebook.react.flat;
import com.facebook.csslayout.Spacing;
interface AndroidView {
/**
@@ -31,7 +29,7 @@ interface AndroidView {
void resetPaddingChanged();
/**
* Get this node's padding, as defined by style + default padding.
* Get the padding for a certain spacingType defined in com.facebook.csslayout.Spacing
*/
Spacing getPadding();
float getPadding(int spacingType);
}