diff --git a/ReactAndroid/src/main/java/com/facebook/csslayout/CSSNode.java b/ReactAndroid/src/main/java/com/facebook/csslayout/CSSNode.java index 3ea3b2c54..25382a79f 100644 --- a/ReactAndroid/src/main/java/com/facebook/csslayout/CSSNode.java +++ b/ReactAndroid/src/main/java/com/facebook/csslayout/CSSNode.java @@ -63,6 +63,7 @@ public class CSSNode implements CSSNodeAPI { private @Nullable MeasureFunction mMeasureFunction = null; private LayoutState mLayoutState = LayoutState.DIRTY; private boolean mIsTextNode = false; + private Object mData; @Override public void init() { @@ -621,6 +622,16 @@ public class CSSNode implements CSSNodeAPI { } } + @Override + public void setData(Object data) { + mData = data; + } + + @Override + public Object getData() { + return mData; + } + /** * Resets this instance to its default state. This method is meant to be used when * recycling {@link CSSNode} instances. diff --git a/ReactAndroid/src/main/java/com/facebook/csslayout/CSSNodeAPI.java b/ReactAndroid/src/main/java/com/facebook/csslayout/CSSNodeAPI.java index 765b135b3..fd8342234 100644 --- a/ReactAndroid/src/main/java/com/facebook/csslayout/CSSNodeAPI.java +++ b/ReactAndroid/src/main/java/com/facebook/csslayout/CSSNodeAPI.java @@ -88,6 +88,8 @@ public interface CSSNodeAPI { void setDefaultPadding(int spacingType, float padding); CSSOverflow getOverflow(); void setOverflow(CSSOverflow overflow); + void setData(Object data); + Object getData(); void init(); void reset(); } diff --git a/ReactAndroid/src/main/java/com/facebook/csslayout/CSSNodeJNI.java b/ReactAndroid/src/main/java/com/facebook/csslayout/CSSNodeJNI.java index 2c84f9c12..aad1b465c 100644 --- a/ReactAndroid/src/main/java/com/facebook/csslayout/CSSNodeJNI.java +++ b/ReactAndroid/src/main/java/com/facebook/csslayout/CSSNodeJNI.java @@ -33,6 +33,7 @@ public class CSSNodeJNI implements CSSNodeAPI { private List mChildren; private MeasureFunction mMeasureFunction; private int mNativePointer; + private Object mData; private void assertNativeInstance() { if (mNativePointer == 0) { @@ -718,4 +719,14 @@ public class CSSNodeJNI implements CSSNodeAPI { public boolean valuesEqual(float f1, float f2) { return FloatUtil.floatsEqual(f1, f2); } + + @Override + public void setData(Object data) { + mData = data; + } + + @Override + public Object getData() { + return mData; + } }