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 0ce91a60391..5a6cb05e031 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/flat/FlatARTSurfaceViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/flat/FlatARTSurfaceViewManager.java @@ -23,13 +23,12 @@ import com.facebook.react.views.art.ARTSurfaceView; private static final CSSNodeAPI.MeasureFunction MEASURE_FUNCTION = new CSSNodeAPI.MeasureFunction() { @Override - public void measure( + public long measure( CSSNodeAPI node, float width, CSSMeasureMode widthMode, float height, - CSSMeasureMode heightMode, - MeasureOutput measureOutput) { + CSSMeasureMode heightMode) { throw new IllegalStateException("SurfaceView should have explicit width and height set"); } }; 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 7211a8bb38e..f0ef5b8a84c 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/flat/RCTText.java +++ b/ReactAndroid/src/main/java/com/facebook/react/flat/RCTText.java @@ -73,21 +73,18 @@ import com.facebook.react.uimanager.annotations.ReactProp; } @Override - public void measure( + public long measure( CSSNodeAPI node, float width, CSSMeasureMode widthMode, float height, - CSSMeasureMode heightMode, - MeasureOutput measureOutput) { + CSSMeasureMode heightMode) { CharSequence text = getText(); if (TextUtils.isEmpty(text)) { // to indicate that we don't have anything to display mText = null; - measureOutput.width = 0; - measureOutput.height = 0; - return; + return MeasureOutput.make(0, 0); } else { mText = text; } @@ -112,8 +109,7 @@ import com.facebook.react.uimanager.annotations.ReactProp; mDrawCommand = new DrawTextLayout(layout); } - measureOutput.width = mDrawCommand.getLayoutWidth(); - measureOutput.height = mDrawCommand.getLayoutHeight(); + return MeasureOutput.make(mDrawCommand.getLayoutWidth(), mDrawCommand.getLayoutHeight()); } @Override 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 a0edc926bf4..f30c72d7a76 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/flat/RCTTextInput.java +++ b/ReactAndroid/src/main/java/com/facebook/react/flat/RCTTextInput.java @@ -75,13 +75,12 @@ public class RCTTextInput extends RCTVirtualText implements AndroidView, CSSNode } @Override - public void measure( + public long measure( CSSNodeAPI node, float width, CSSMeasureMode widthMode, float height, - CSSMeasureMode heightMode, - MeasureOutput measureOutput) { + CSSMeasureMode heightMode) { // measure() should never be called before setThemedContext() EditText editText = Assertions.assertNotNull(mEditText); @@ -103,8 +102,7 @@ public class RCTTextInput extends RCTVirtualText implements AndroidView, CSSNode editText.measure( MeasureUtil.getMeasureSpec(width, widthMode), MeasureUtil.getMeasureSpec(height, heightMode)); - measureOutput.width = editText.getMeasuredWidth(); - measureOutput.height = editText.getMeasuredHeight(); + return MeasureOutput.make(editText.getMeasuredWidth(), editText.getMeasuredHeight()); } @Override