diff --git a/ReactAndroid/src/main/java/com/facebook/react/flat/FlatARTSurfaceViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/flat/FlatARTSurfaceViewManager.java index 730af183d..a3fad3aba 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/flat/FlatARTSurfaceViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/flat/FlatARTSurfaceViewManager.java @@ -11,7 +11,7 @@ package com.facebook.react.flat; import com.facebook.yoga.YogaMeasureMode; import com.facebook.yoga.YogaMeasureFunction; -import com.facebook.yoga.YogaNodeAPI; +import com.facebook.yoga.YogaNode; import com.facebook.react.uimanager.BaseViewManager; import com.facebook.react.uimanager.ThemedReactContext; import com.facebook.react.views.art.ARTSurfaceView; @@ -24,7 +24,7 @@ public class FlatARTSurfaceViewManager extends private static final YogaMeasureFunction MEASURE_FUNCTION = new YogaMeasureFunction() { @Override public long measure( - YogaNodeAPI node, + YogaNode node, float width, YogaMeasureMode widthMode, float height, diff --git a/ReactAndroid/src/main/java/com/facebook/react/flat/RCTText.java b/ReactAndroid/src/main/java/com/facebook/react/flat/RCTText.java index fb97bdeab..e10278171 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/flat/RCTText.java +++ b/ReactAndroid/src/main/java/com/facebook/react/flat/RCTText.java @@ -19,7 +19,7 @@ import android.view.Gravity; import com.facebook.yoga.YogaDirection; import com.facebook.yoga.YogaMeasureMode; import com.facebook.yoga.YogaMeasureFunction; -import com.facebook.yoga.YogaNodeAPI; +import com.facebook.yoga.YogaNode; import com.facebook.yoga.YogaMeasureOutput; import com.facebook.fbui.textlayoutbuilder.TextLayoutBuilder; import com.facebook.fbui.textlayoutbuilder.glyphwarmer.GlyphWarmerImpl; @@ -75,7 +75,7 @@ import com.facebook.react.uimanager.annotations.ReactProp; @Override public long measure( - YogaNodeAPI node, + YogaNode node, float width, YogaMeasureMode widthMode, float height, diff --git a/ReactAndroid/src/main/java/com/facebook/react/flat/RCTTextInput.java b/ReactAndroid/src/main/java/com/facebook/react/flat/RCTTextInput.java index 4b609d737..2af86a5a7 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/flat/RCTTextInput.java +++ b/ReactAndroid/src/main/java/com/facebook/react/flat/RCTTextInput.java @@ -20,7 +20,7 @@ import android.widget.EditText; import com.facebook.yoga.YogaMeasureMode; import com.facebook.yoga.YogaMeasureFunction; -import com.facebook.yoga.YogaNodeAPI; +import com.facebook.yoga.YogaNode; import com.facebook.yoga.YogaMeasureOutput; import com.facebook.infer.annotation.Assertions; import com.facebook.react.uimanager.PixelUtil; @@ -78,7 +78,7 @@ public class RCTTextInput extends RCTVirtualText implements AndroidView, YogaMea @Override public long measure( - YogaNodeAPI node, + YogaNode node, float width, YogaMeasureMode widthMode, float height, diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTSurfaceViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTSurfaceViewManager.java index 23d590729..13745a58a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTSurfaceViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTSurfaceViewManager.java @@ -11,7 +11,7 @@ package com.facebook.react.views.art; import com.facebook.yoga.YogaMeasureMode; import com.facebook.yoga.YogaMeasureFunction; -import com.facebook.yoga.YogaNodeAPI; +import com.facebook.yoga.YogaNode; import com.facebook.react.module.annotations.ReactModule; import com.facebook.react.uimanager.BaseViewManager; import com.facebook.react.uimanager.ThemedReactContext; @@ -29,7 +29,7 @@ public class ARTSurfaceViewManager extends private static final YogaMeasureFunction MEASURE_FUNCTION = new YogaMeasureFunction() { @Override public long measure( - YogaNodeAPI node, + YogaNode node, float width, YogaMeasureMode widthMode, float height, diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ProgressBarShadowNode.java b/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ProgressBarShadowNode.java index 48266ba0b..e8209c002 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ProgressBarShadowNode.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/progressbar/ProgressBarShadowNode.java @@ -21,7 +21,7 @@ import android.widget.ProgressBar; import com.facebook.yoga.YogaMeasureMode; import com.facebook.yoga.YogaMeasureFunction; -import com.facebook.yoga.YogaNodeAPI; +import com.facebook.yoga.YogaNode; import com.facebook.yoga.YogaMeasureOutput; import com.facebook.react.uimanager.LayoutShadowNode; import com.facebook.react.uimanager.annotations.ReactProp; @@ -54,7 +54,7 @@ public class ProgressBarShadowNode extends LayoutShadowNode implements YogaMeasu @Override public long measure( - YogaNodeAPI node, + YogaNode node, float width, YogaMeasureMode widthMode, float height, diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSliderManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSliderManager.java index c7488091a..fe9ac4220 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSliderManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/slider/ReactSliderManager.java @@ -30,7 +30,7 @@ import com.facebook.react.uimanager.annotations.ReactProp; import com.facebook.yoga.YogaMeasureFunction; import com.facebook.yoga.YogaMeasureMode; import com.facebook.yoga.YogaMeasureOutput; -import com.facebook.yoga.YogaNodeAPI; +import com.facebook.yoga.YogaNode; import java.util.Map; @@ -58,7 +58,7 @@ public class ReactSliderManager extends SimpleViewManager { @Override public long measure( - YogaNodeAPI node, + YogaNode node, float width, YogaMeasureMode widthMode, float height, diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchManager.java index 5c70e8b35..73f687345 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/switchview/ReactSwitchManager.java @@ -17,7 +17,7 @@ import android.widget.CompoundButton; import com.facebook.yoga.YogaMeasureMode; import com.facebook.yoga.YogaMeasureFunction; -import com.facebook.yoga.YogaNodeAPI; +import com.facebook.yoga.YogaNode; import com.facebook.yoga.YogaMeasureOutput; import com.facebook.react.bridge.ReactContext; import com.facebook.react.uimanager.LayoutShadowNode; @@ -47,7 +47,7 @@ public class ReactSwitchManager extends SimpleViewManager { @Override public long measure( - YogaNodeAPI node, + YogaNode node, float width, YogaMeasureMode widthMode, float height, diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java index fbfe8a753..dbdcc2963 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextShadowNode.java @@ -35,7 +35,7 @@ import com.facebook.yoga.YogaDirection; import com.facebook.yoga.YogaConstants; import com.facebook.yoga.YogaMeasureMode; import com.facebook.yoga.YogaMeasureFunction; -import com.facebook.yoga.YogaNodeAPI; +import com.facebook.yoga.YogaNode; import com.facebook.yoga.YogaMeasureOutput; import com.facebook.infer.annotation.Assertions; import com.facebook.react.bridge.JSApplicationIllegalArgumentException; @@ -225,7 +225,7 @@ public class ReactTextShadowNode extends LayoutShadowNode { new YogaMeasureFunction() { @Override public long measure( - YogaNodeAPI node, + YogaNode node, float width, YogaMeasureMode widthMode, float height, diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputShadowNode.java b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputShadowNode.java index 362e50c89..2e6c5493c 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputShadowNode.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputShadowNode.java @@ -22,7 +22,7 @@ import android.widget.EditText; import com.facebook.yoga.YogaDirection; import com.facebook.yoga.YogaMeasureMode; import com.facebook.yoga.YogaMeasureFunction; -import com.facebook.yoga.YogaNodeAPI; +import com.facebook.yoga.YogaNode; import com.facebook.yoga.YogaMeasureOutput; import com.facebook.infer.annotation.Assertions; import com.facebook.react.bridge.JSApplicationIllegalArgumentException; @@ -73,7 +73,7 @@ public class ReactTextInputShadowNode extends ReactTextShadowNode implements @Override public long measure( - YogaNodeAPI node, + YogaNode node, float width, YogaMeasureMode widthMode, float height, diff --git a/ReactAndroid/src/main/java/com/facebook/yoga/YogaBaselineFunction.java b/ReactAndroid/src/main/java/com/facebook/yoga/YogaBaselineFunction.java index 60de81c56..845b128f0 100644 --- a/ReactAndroid/src/main/java/com/facebook/yoga/YogaBaselineFunction.java +++ b/ReactAndroid/src/main/java/com/facebook/yoga/YogaBaselineFunction.java @@ -18,5 +18,5 @@ public interface YogaBaselineFunction { * default to the computed height of the node. */ @DoNotStrip - float baseline(YogaNodeAPI node, float width, float height); + float baseline(YogaNode node, float width, float height); } diff --git a/ReactAndroid/src/main/java/com/facebook/yoga/YogaMeasureFunction.java b/ReactAndroid/src/main/java/com/facebook/yoga/YogaMeasureFunction.java index 6570e5b5b..637551f34 100644 --- a/ReactAndroid/src/main/java/com/facebook/yoga/YogaMeasureFunction.java +++ b/ReactAndroid/src/main/java/com/facebook/yoga/YogaMeasureFunction.java @@ -18,7 +18,7 @@ public interface YogaMeasureFunction { */ @DoNotStrip long measure( - YogaNodeAPI node, + YogaNode node, float width, YogaMeasureMode widthMode, float height, diff --git a/ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.java b/ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.java index a0770e9a0..f5d4fab03 100644 --- a/ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.java +++ b/ReactAndroid/src/main/java/com/facebook/yoga/YogaNode.java @@ -18,7 +18,7 @@ import com.facebook.proguard.annotations.DoNotStrip; import com.facebook.soloader.SoLoader; @DoNotStrip -public class YogaNode implements YogaNodeAPI { +public class YogaNode { static { SoLoader.loadLibrary("yoga"); @@ -106,7 +106,6 @@ public class YogaNode implements YogaNodeAPI { } private native void jni_YGNodeFree(long nativePointer); - @Override protected void finalize() throws Throwable { try { jni_YGNodeFree(mNativePointer); @@ -116,7 +115,6 @@ public class YogaNode implements YogaNodeAPI { } private native void jni_YGNodeReset(long nativePointer); - @Override public void reset() { mEdgeSetFlag = 0; mHasSetPosition = false; @@ -146,18 +144,15 @@ public class YogaNode implements YogaNodeAPI { jni_YGNodeReset(mNativePointer); } - @Override public int getChildCount() { return mChildren == null ? 0 : mChildren.size(); } - @Override public YogaNode getChildAt(int i) { return mChildren.get(i); } private native void jni_YGNodeInsertChild(long nativePointer, long childPointer, int index); - @Override public void addChildAt(YogaNode child, int i) { if (child.mParent != null) { throw new IllegalStateException("Child already has a parent, it must be removed first."); @@ -172,7 +167,6 @@ public class YogaNode implements YogaNodeAPI { } private native void jni_YGNodeRemoveChild(long nativePointer, long childPointer); - @Override public YogaNode removeChildAt(int i) { final YogaNode child = mChildren.remove(i); @@ -181,221 +175,184 @@ public class YogaNode implements YogaNodeAPI { return child; } - @Override public @Nullable YogaNode getParent() { return mParent; } - @Override public int indexOf(YogaNode child) { return mChildren == null ? -1 : mChildren.indexOf(child); } private native void jni_YGNodeCalculateLayout(long nativePointer, float width, float height); - @Override public void calculateLayout(float width, float height) { jni_YGNodeCalculateLayout(mNativePointer, width, height); } - @Override public boolean hasNewLayout() { return mHasNewLayout; } private native void jni_YGNodeMarkDirty(long nativePointer); - @Override public void dirty() { jni_YGNodeMarkDirty(mNativePointer); } private native boolean jni_YGNodeIsDirty(long nativePointer); - @Override public boolean isDirty() { return jni_YGNodeIsDirty(mNativePointer); } private native void jni_YGNodeCopyStyle(long dstNativePointer, long srcNativePointer); - @Override public void copyStyle(YogaNode srcNode) { jni_YGNodeCopyStyle(mNativePointer, srcNode.mNativePointer); } - @Override public void markLayoutSeen() { mHasNewLayout = false; } private native int jni_YGNodeStyleGetDirection(long nativePointer); - @Override public YogaDirection getStyleDirection() { return YogaDirection.fromInt(jni_YGNodeStyleGetDirection(mNativePointer)); } private native void jni_YGNodeStyleSetDirection(long nativePointer, int direction); - @Override public void setDirection(YogaDirection direction) { jni_YGNodeStyleSetDirection(mNativePointer, direction.intValue()); } private native int jni_YGNodeStyleGetFlexDirection(long nativePointer); - @Override public YogaFlexDirection getFlexDirection() { return YogaFlexDirection.fromInt(jni_YGNodeStyleGetFlexDirection(mNativePointer)); } private native void jni_YGNodeStyleSetFlexDirection(long nativePointer, int flexDirection); - @Override public void setFlexDirection(YogaFlexDirection flexDirection) { jni_YGNodeStyleSetFlexDirection(mNativePointer, flexDirection.intValue()); } private native int jni_YGNodeStyleGetJustifyContent(long nativePointer); - @Override public YogaJustify getJustifyContent() { return YogaJustify.fromInt(jni_YGNodeStyleGetJustifyContent(mNativePointer)); } private native void jni_YGNodeStyleSetJustifyContent(long nativePointer, int justifyContent); - @Override public void setJustifyContent(YogaJustify justifyContent) { jni_YGNodeStyleSetJustifyContent(mNativePointer, justifyContent.intValue()); } private native int jni_YGNodeStyleGetAlignItems(long nativePointer); - @Override public YogaAlign getAlignItems() { return YogaAlign.fromInt(jni_YGNodeStyleGetAlignItems(mNativePointer)); } private native void jni_YGNodeStyleSetAlignItems(long nativePointer, int alignItems); - @Override public void setAlignItems(YogaAlign alignItems) { jni_YGNodeStyleSetAlignItems(mNativePointer, alignItems.intValue()); } private native int jni_YGNodeStyleGetAlignSelf(long nativePointer); - @Override public YogaAlign getAlignSelf() { return YogaAlign.fromInt(jni_YGNodeStyleGetAlignSelf(mNativePointer)); } private native void jni_YGNodeStyleSetAlignSelf(long nativePointer, int alignSelf); - @Override public void setAlignSelf(YogaAlign alignSelf) { jni_YGNodeStyleSetAlignSelf(mNativePointer, alignSelf.intValue()); } private native int jni_YGNodeStyleGetAlignContent(long nativePointer); - @Override public YogaAlign getAlignContent() { return YogaAlign.fromInt(jni_YGNodeStyleGetAlignContent(mNativePointer)); } private native void jni_YGNodeStyleSetAlignContent(long nativePointer, int alignContent); - @Override public void setAlignContent(YogaAlign alignContent) { jni_YGNodeStyleSetAlignContent(mNativePointer, alignContent.intValue()); } private native int jni_YGNodeStyleGetPositionType(long nativePointer); - @Override public YogaPositionType getPositionType() { return YogaPositionType.fromInt(jni_YGNodeStyleGetPositionType(mNativePointer)); } private native void jni_YGNodeStyleSetPositionType(long nativePointer, int positionType); - @Override public void setPositionType(YogaPositionType positionType) { jni_YGNodeStyleSetPositionType(mNativePointer, positionType.intValue()); } private native void jni_YGNodeStyleSetFlexWrap(long nativePointer, int wrapType); - @Override public void setWrap(YogaWrap flexWrap) { jni_YGNodeStyleSetFlexWrap(mNativePointer, flexWrap.intValue()); } private native int jni_YGNodeStyleGetOverflow(long nativePointer); - @Override public YogaOverflow getOverflow() { return YogaOverflow.fromInt(jni_YGNodeStyleGetOverflow(mNativePointer)); } private native void jni_YGNodeStyleSetOverflow(long nativePointer, int overflow); - @Override public void setOverflow(YogaOverflow overflow) { jni_YGNodeStyleSetOverflow(mNativePointer, overflow.intValue()); } private native int jni_YGNodeStyleGetDisplay(long nativePointer); - @Override public YogaDisplay getDisplay() { return YogaDisplay.fromInt(jni_YGNodeStyleGetDisplay(mNativePointer)); } private native void jni_YGNodeStyleSetDisplay(long nativePointer, int display); - @Override public void setDisplay(YogaDisplay display) { jni_YGNodeStyleSetDisplay(mNativePointer, display.intValue()); } private native void jni_YGNodeStyleSetFlex(long nativePointer, float flex); - @Override public void setFlex(float flex) { jni_YGNodeStyleSetFlex(mNativePointer, flex); } private native float jni_YGNodeStyleGetFlexGrow(long nativePointer); - @Override public float getFlexGrow() { return jni_YGNodeStyleGetFlexGrow(mNativePointer); } private native void jni_YGNodeStyleSetFlexGrow(long nativePointer, float flexGrow); - @Override public void setFlexGrow(float flexGrow) { jni_YGNodeStyleSetFlexGrow(mNativePointer, flexGrow); } private native float jni_YGNodeStyleGetFlexShrink(long nativePointer); - @Override public float getFlexShrink() { return jni_YGNodeStyleGetFlexShrink(mNativePointer); } private native void jni_YGNodeStyleSetFlexShrink(long nativePointer, float flexShrink); - @Override public void setFlexShrink(float flexShrink) { jni_YGNodeStyleSetFlexShrink(mNativePointer, flexShrink); } private native Object jni_YGNodeStyleGetFlexBasis(long nativePointer); - @Override public YogaValue getFlexBasis() { return (YogaValue) jni_YGNodeStyleGetFlexBasis(mNativePointer); } private native void jni_YGNodeStyleSetFlexBasis(long nativePointer, float flexBasis); - @Override public void setFlexBasis(float flexBasis) { jni_YGNodeStyleSetFlexBasis(mNativePointer, flexBasis); } private native void jni_YGNodeStyleSetFlexBasisPercent(long nativePointer, float percent); - @Override public void setFlexBasisPercent(float percent) { jni_YGNodeStyleSetFlexBasisPercent(mNativePointer, percent); } private native void jni_YGNodeStyleSetFlexBasisAuto(long nativePointer); - @Override public void setFlexBasisAuto() { jni_YGNodeStyleSetFlexBasisAuto(mNativePointer); } private native Object jni_YGNodeStyleGetMargin(long nativePointer, int edge); - @Override public YogaValue getMargin(YogaEdge edge) { if (!((mEdgeSetFlag & MARGIN) == MARGIN)) { return YogaValue.UNDEFINED; @@ -404,28 +361,24 @@ public class YogaNode implements YogaNodeAPI { } private native void jni_YGNodeStyleSetMargin(long nativePointer, int edge, float margin); - @Override public void setMargin(YogaEdge edge, float margin) { mEdgeSetFlag |= MARGIN; jni_YGNodeStyleSetMargin(mNativePointer, edge.intValue(), margin); } private native void jni_YGNodeStyleSetMarginPercent(long nativePointer, int edge, float percent); - @Override public void setMarginPercent(YogaEdge edge, float percent) { mEdgeSetFlag |= MARGIN; jni_YGNodeStyleSetMarginPercent(mNativePointer, edge.intValue(), percent); } private native void jni_YGNodeStyleSetMarginAuto(long nativePointer, int edge); - @Override public void setMarginAuto(YogaEdge edge) { mEdgeSetFlag |= MARGIN; jni_YGNodeStyleSetMarginAuto(mNativePointer, edge.intValue()); } private native Object jni_YGNodeStyleGetPadding(long nativePointer, int edge); - @Override public YogaValue getPadding(YogaEdge edge) { if (!((mEdgeSetFlag & PADDING) == PADDING)) { return YogaValue.UNDEFINED; @@ -434,21 +387,18 @@ public class YogaNode implements YogaNodeAPI { } private native void jni_YGNodeStyleSetPadding(long nativePointer, int edge, float padding); - @Override public void setPadding(YogaEdge edge, float padding) { mEdgeSetFlag |= PADDING; jni_YGNodeStyleSetPadding(mNativePointer, edge.intValue(), padding); } private native void jni_YGNodeStyleSetPaddingPercent(long nativePointer, int edge, float percent); - @Override public void setPaddingPercent(YogaEdge edge, float percent) { mEdgeSetFlag |= PADDING; jni_YGNodeStyleSetPaddingPercent(mNativePointer, edge.intValue(), percent); } private native float jni_YGNodeStyleGetBorder(long nativePointer, int edge); - @Override public float getBorder(YogaEdge edge) { if (!((mEdgeSetFlag & BORDER) == BORDER)) { return YogaConstants.UNDEFINED; @@ -457,14 +407,12 @@ public class YogaNode implements YogaNodeAPI { } private native void jni_YGNodeStyleSetBorder(long nativePointer, int edge, float border); - @Override public void setBorder(YogaEdge edge, float border) { mEdgeSetFlag |= BORDER; jni_YGNodeStyleSetBorder(mNativePointer, edge.intValue(), border); } private native Object jni_YGNodeStyleGetPosition(long nativePointer, int edge); - @Override public YogaValue getPosition(YogaEdge edge) { if (!mHasSetPosition) { return YogaValue.UNDEFINED; @@ -473,135 +421,113 @@ public class YogaNode implements YogaNodeAPI { } private native void jni_YGNodeStyleSetPosition(long nativePointer, int edge, float position); - @Override public void setPosition(YogaEdge edge, float position) { mHasSetPosition = true; jni_YGNodeStyleSetPosition(mNativePointer, edge.intValue(), position); } private native void jni_YGNodeStyleSetPositionPercent(long nativePointer, int edge, float percent); - @Override public void setPositionPercent(YogaEdge edge, float percent) { mHasSetPosition = true; jni_YGNodeStyleSetPositionPercent(mNativePointer, edge.intValue(), percent); } private native Object jni_YGNodeStyleGetWidth(long nativePointer); - @Override public YogaValue getWidth() { return (YogaValue) jni_YGNodeStyleGetWidth(mNativePointer); } private native void jni_YGNodeStyleSetWidth(long nativePointer, float width); - @Override public void setWidth(float width) { jni_YGNodeStyleSetWidth(mNativePointer, width); } private native void jni_YGNodeStyleSetWidthPercent(long nativePointer, float percent); - @Override public void setWidthPercent(float percent) { jni_YGNodeStyleSetWidthPercent(mNativePointer, percent); } private native void jni_YGNodeStyleSetWidthAuto(long nativePointer); - @Override public void setWidthAuto() { jni_YGNodeStyleSetWidthAuto(mNativePointer); } private native Object jni_YGNodeStyleGetHeight(long nativePointer); - @Override public YogaValue getHeight() { return (YogaValue) jni_YGNodeStyleGetHeight(mNativePointer); } private native void jni_YGNodeStyleSetHeight(long nativePointer, float height); - @Override public void setHeight(float height) { jni_YGNodeStyleSetHeight(mNativePointer, height); } private native void jni_YGNodeStyleSetHeightPercent(long nativePointer, float percent); - @Override public void setHeightPercent(float percent) { jni_YGNodeStyleSetHeightPercent(mNativePointer, percent); } private native void jni_YGNodeStyleSetHeightAuto(long nativePointer); - @Override public void setHeightAuto() { jni_YGNodeStyleSetHeightAuto(mNativePointer); } private native Object jni_YGNodeStyleGetMinWidth(long nativePointer); - @Override public YogaValue getMinWidth() { return (YogaValue) jni_YGNodeStyleGetMinWidth(mNativePointer); } private native void jni_YGNodeStyleSetMinWidth(long nativePointer, float minWidth); - @Override public void setMinWidth(float minWidth) { jni_YGNodeStyleSetMinWidth(mNativePointer, minWidth); } private native void jni_YGNodeStyleSetMinWidthPercent(long nativePointer, float percent); - @Override public void setMinWidthPercent(float percent) { jni_YGNodeStyleSetMinWidthPercent(mNativePointer, percent); } private native Object jni_YGNodeStyleGetMinHeight(long nativePointer); - @Override public YogaValue getMinHeight() { return (YogaValue) jni_YGNodeStyleGetMinHeight(mNativePointer); } private native void jni_YGNodeStyleSetMinHeight(long nativePointer, float minHeight); - @Override public void setMinHeight(float minHeight) { jni_YGNodeStyleSetMinHeight(mNativePointer, minHeight); } private native void jni_YGNodeStyleSetMinHeightPercent(long nativePointer, float percent); - @Override public void setMinHeightPercent(float percent) { jni_YGNodeStyleSetMinHeightPercent(mNativePointer, percent); } private native Object jni_YGNodeStyleGetMaxWidth(long nativePointer); - @Override public YogaValue getMaxWidth() { return (YogaValue) jni_YGNodeStyleGetMaxWidth(mNativePointer); } private native void jni_YGNodeStyleSetMaxWidth(long nativePointer, float maxWidth); - @Override public void setMaxWidth(float maxWidth) { jni_YGNodeStyleSetMaxWidth(mNativePointer, maxWidth); } private native void jni_YGNodeStyleSetMaxWidthPercent(long nativePointer, float percent); - @Override public void setMaxWidthPercent(float percent) { jni_YGNodeStyleSetMaxWidthPercent(mNativePointer, percent); } private native Object jni_YGNodeStyleGetMaxHeight(long nativePointer); - @Override public YogaValue getMaxHeight() { return (YogaValue) jni_YGNodeStyleGetMaxHeight(mNativePointer); } private native void jni_YGNodeStyleSetMaxHeight(long nativePointer, float maxheight); - @Override public void setMaxHeight(float maxheight) { jni_YGNodeStyleSetMaxHeight(mNativePointer, maxheight); } private native void jni_YGNodeStyleSetMaxHeightPercent(long nativePointer, float percent); - @Override public void setMaxHeightPercent(float percent) { jni_YGNodeStyleSetMaxHeightPercent(mNativePointer, percent); } @@ -616,27 +542,22 @@ public class YogaNode implements YogaNodeAPI { jni_YGNodeStyleSetAspectRatio(mNativePointer, aspectRatio); } - @Override public float getLayoutX() { return mLeft; } - @Override public float getLayoutY() { return mTop; } - @Override public float getLayoutWidth() { return mWidth; } - @Override public float getLayoutHeight() { return mHeight; } - @Override public float getLayoutMargin(YogaEdge edge) { switch (edge) { case LEFT: @@ -656,7 +577,6 @@ public class YogaNode implements YogaNodeAPI { } } - @Override public float getLayoutPadding(YogaEdge edge) { switch (edge) { case LEFT: @@ -676,7 +596,6 @@ public class YogaNode implements YogaNodeAPI { } } - @Override public float getLayoutBorder(YogaEdge edge) { switch (edge) { case LEFT: @@ -696,13 +615,11 @@ public class YogaNode implements YogaNodeAPI { } } - @Override public YogaDirection getLayoutDirection() { return YogaDirection.fromInt(mLayoutDirection); } private native void jni_YGNodeSetHasMeasureFunc(long nativePointer, boolean hasMeasureFunc); - @Override public void setMeasureFunction(YogaMeasureFunction measureFunction) { mMeasureFunction = measureFunction; jni_YGNodeSetHasMeasureFunc(mNativePointer, measureFunction != null); @@ -728,7 +645,6 @@ public class YogaNode implements YogaNodeAPI { } private native void jni_YGNodeSetHasBaselineFunc(long nativePointer, boolean hasMeasureFunc); - @Override public void setBaselineFunction(YogaBaselineFunction baselineFunction) { mBaselineFunction = baselineFunction; jni_YGNodeSetHasBaselineFunc(mNativePointer, baselineFunction != null); @@ -739,17 +655,14 @@ public class YogaNode implements YogaNodeAPI { return mBaselineFunction.baseline(this, width, height); } - @Override public boolean isMeasureDefined() { return mMeasureFunction != null; } - @Override public void setData(Object data) { mData = data; } - @Override public Object getData() { return mData; } diff --git a/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeAPI.java b/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeAPI.java deleted file mode 100644 index 1c4af327d..000000000 --- a/ReactAndroid/src/main/java/com/facebook/yoga/YogaNodeAPI.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package com.facebook.yoga; - -// This only exists for legacy reasons. It will be removed sometime in the near future. -public interface YogaNodeAPI { - int getChildCount(); - YogaNodeType getChildAt(int i); - void addChildAt(YogaNodeType child, int i); - YogaNodeType removeChildAt(int i); - YogaNodeType getParent(); - int indexOf(YogaNodeType child); - void setMeasureFunction(YogaMeasureFunction measureFunction); - void setBaselineFunction(YogaBaselineFunction measureFunction); - boolean isMeasureDefined(); - void calculateLayout(float width, float height); - boolean isDirty(); - boolean hasNewLayout(); - void dirty(); - void markLayoutSeen(); - void copyStyle(YogaNodeType srcNode); - YogaDirection getStyleDirection(); - void setDirection(YogaDirection direction); - YogaFlexDirection getFlexDirection(); - void setFlexDirection(YogaFlexDirection flexDirection); - YogaJustify getJustifyContent(); - void setJustifyContent(YogaJustify justifyContent); - YogaAlign getAlignItems(); - void setAlignItems(YogaAlign alignItems); - YogaAlign getAlignSelf(); - void setAlignSelf(YogaAlign alignSelf); - YogaAlign getAlignContent(); - void setAlignContent(YogaAlign alignContent); - YogaPositionType getPositionType(); - void setPositionType(YogaPositionType positionType); - void setWrap(YogaWrap flexWrap); - void setFlex(float flex); - float getFlexGrow(); - void setFlexGrow(float flexGrow); - float getFlexShrink(); - void setFlexShrink(float flexShrink); - YogaValue getFlexBasis(); - void setFlexBasis(float flexBasis); - void setFlexBasisPercent(float percent); - void setFlexBasisAuto(); - YogaValue getMargin(YogaEdge edge); - void setMargin(YogaEdge edge, float margin); - void setMarginPercent(YogaEdge edge, float percent); - void setMarginAuto(YogaEdge edge); - YogaValue getPadding(YogaEdge edge); - void setPadding(YogaEdge edge, float padding); - void setPaddingPercent(YogaEdge edge, float percent); - float getBorder(YogaEdge edge); - void setBorder(YogaEdge edge, float border); - YogaValue getPosition(YogaEdge edge); - void setPosition(YogaEdge edge, float position); - void setPositionPercent(YogaEdge edge, float percent); - YogaValue getWidth(); - void setWidth(float width); - void setWidthPercent(float percent); - void setWidthAuto(); - YogaValue getHeight(); - void setHeight(float height); - void setHeightPercent(float percent); - void setHeightAuto(); - YogaValue getMaxWidth(); - void setMaxWidth(float maxWidth); - void setMaxWidthPercent(float percent); - YogaValue getMinWidth(); - void setMinWidth(float minWidth); - void setMinWidthPercent(float percent); - YogaValue getMaxHeight(); - void setMaxHeight(float maxHeight); - void setMaxHeightPercent(float percent); - YogaValue getMinHeight(); - void setMinHeight(float minHeight); - void setMinHeightPercent(float percent); - float getLayoutX(); - float getLayoutY(); - float getLayoutWidth(); - float getLayoutHeight(); - float getLayoutMargin(YogaEdge edge); - float getLayoutPadding(YogaEdge edge); - float getLayoutBorder(YogaEdge edge); - YogaDirection getLayoutDirection(); - YogaOverflow getOverflow(); - void setOverflow(YogaOverflow overflow); - YogaDisplay getDisplay(); - void setDisplay(YogaDisplay display); - void setData(Object data); - Object getData(); - void reset(); -}