Skip to content

Commit

Permalink
Disable rendering of inline views in Classic RN code for views that a…
Browse files Browse the repository at this point in the history
…re rendered in Fabric

Summary:
This diff disables the rendering of TextInlineViews in ClassicRN when the users is running with Fabric enabled.

changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D20087254

fbshipit-source-id: b4664b17b4c845d212f72e75eee58860fe31abee
  • Loading branch information
mdvacca authored and facebook-github-bot committed Feb 25, 2020
1 parent 8bc7ad6 commit 0e69922
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import com.facebook.react.uimanager.ReactCompoundView;
import com.facebook.react.uimanager.UIManagerModule;
import com.facebook.react.uimanager.ViewDefaults;
import com.facebook.react.uimanager.common.UIManagerType;
import com.facebook.react.uimanager.common.ViewUtil;
import com.facebook.react.uimanager.events.RCTEventEmitter;
import com.facebook.react.views.view.ReactViewBackgroundManager;
import java.util.ArrayList;
Expand Down Expand Up @@ -66,7 +68,7 @@ public ReactTextView(Context context) {
mDefaultGravityVertical = getGravity() & Gravity.VERTICAL_GRAVITY_MASK;
}

private WritableMap inlineViewJson(
private static WritableMap inlineViewJson(
int visibility, int index, int left, int top, int right, int bottom) {
WritableMap json = Arguments.createMap();
if (visibility == View.GONE) {
Expand Down Expand Up @@ -96,7 +98,9 @@ private ReactContext getReactContext() {
@Override
protected void onLayout(
boolean changed, int textViewLeft, int textViewTop, int textViewRight, int textViewBottom) {
if (!(getText() instanceof Spanned)) {
// TODO T62882314: Delete this method when Fabric is fully released in OSS
if (!(getText() instanceof Spanned)
|| ViewUtil.getUIManagerType(getId()) == UIManagerType.FABRIC) {
/**
* In general, {@link #setText} is called via {@link ReactTextViewManager#updateExtraData}
* before we are laid out. This ordering is a requirement because we utilize the data from
Expand Down

0 comments on commit 0e69922

Please sign in to comment.