Enable support for TextInlineViews with dynamic sizes by default

Summary:
This diff enables support for TextInlineViews with dynamic sizes by default, removing old code and calls to MCs.

changelog: [internal]

Reviewed By: JoshuaGross, makovkastar

Differential Revision: D20026795

fbshipit-source-id: 48adf356b418866d937be9b478d9186342a07de8
This commit is contained in:
David Vacca
2020-02-21 10:50:20 -08:00
committed by Facebook Github Bot
parent cf20bb8921
commit c918f45046
2 changed files with 5 additions and 12 deletions
@@ -21,7 +21,6 @@ rn_android_library(
react_native_dep("third-party/java/jsr-305:jsr-305"),
react_native_target("java/com/facebook/react/bridge:bridge"),
react_native_target("java/com/facebook/react/common:common"),
react_native_target("java/com/facebook/react/config:config"),
react_native_target("java/com/facebook/react/module/annotations:annotations"),
react_native_target("java/com/facebook/react/uimanager:uimanager"),
react_native_target("java/com/facebook/react/uimanager/annotations:annotations"),
@@ -20,7 +20,6 @@ import com.facebook.infer.annotation.Assertions;
import com.facebook.react.bridge.JSApplicationIllegalArgumentException;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.config.ReactFeatureFlags;
import com.facebook.react.uimanager.IllegalViewOperationException;
import com.facebook.react.uimanager.LayoutShadowNode;
import com.facebook.react.uimanager.NativeViewHierarchyOptimizer;
@@ -142,16 +141,11 @@ public abstract class ReactBaseTextShadowNode extends LayoutShadowNode {
float width;
float height;
if (widthValue.unit != YogaUnit.POINT || heightValue.unit != YogaUnit.POINT) {
if (ReactFeatureFlags.supportInlineViewsWithDynamicSize) {
// If the measurement of the child isn't calculated, we calculate the layout for the
// view using Yoga
child.calculateLayout();
width = child.getLayoutWidth();
height = child.getLayoutHeight();
} else {
throw new IllegalViewOperationException(
"Views nested within a <Text> must have a width and height");
}
// If the measurement of the child isn't calculated, we calculate the layout for the
// view using Yoga
child.calculateLayout();
width = child.getLayoutWidth();
height = child.getLayoutHeight();
} else {
width = widthValue.value;
height = heightValue.value;