Add a React Feature Flag to control TextInlineView fix

Summary:
This diff adds a temporary Feature Flag to control a fix in TextInlineView (see previous diffs of the stack)

changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D20812920

fbshipit-source-id: 90fece9b29ba173546d96e4d9baf1ccabb3031b2
This commit is contained in:
David Vacca
2020-04-02 14:07:29 -07:00
committed by Facebook GitHub Bot
parent 21eb540d6e
commit 3ed1b1f4ff
3 changed files with 26 additions and 1 deletions
@@ -9,9 +9,11 @@ package com.facebook.react.uimanager;
import android.util.SparseBooleanArray;
import androidx.annotation.Nullable;
import com.facebook.common.logging.FLog;
import com.facebook.infer.annotation.Assertions;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMapKeySetIterator;
import com.facebook.react.config.ReactFeatureFlags;
/**
* Class responsible for optimizing the native view hierarchy while still respecting the final UI
@@ -46,6 +48,8 @@ import com.facebook.react.bridge.ReadableMapKeySetIterator;
*/
public class NativeViewHierarchyOptimizer {
private static final String TAG = "NativeViewHierarchyOptimizer";
private static class NodeIndexPair {
public final ReactShadowNode node;
public final int index;
@@ -421,6 +425,18 @@ public class NativeViewHierarchyOptimizer {
// Bit of a hack: we need to update the layout of this node's children now that it's no longer
// layout-only, but we may still receive more layout updates at the end of this batch that we
// don't want to ignore.
if (ReactFeatureFlags.enableTransitionLayoutOnlyViewCleanup) {
FLog.i(
TAG,
"Transitioning LayoutOnlyView - tag: "
+ node.getReactTag()
+ " - rootTag: "
+ node.getRootTag()
+ " - hasProps: "
+ (props != null)
+ " - tagsWithLayout.size: "
+ mTagsWithLayoutVisited.size());
}
Assertions.assertCondition(mTagsWithLayoutVisited.size() == 0);
applyLayoutBase(node);
for (int i = 0; i < node.getChildCount(); i++) {