From b4d28293a64685d79697127ca63e8193041d41d1 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Mon, 16 Sep 2024 19:14:53 -0700 Subject: [PATCH] Remove ReactTextView Legacy Background Path (#46171) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46171 ## This Diff This removes the legacy path from ReactTextView and its view manager. ## This Stack This removes the non-Style-applicator background management paths of the different native components. There have been multiple conflicting changes, and bugs added bc harder to reason about, which motivates making this change as soon as possible. This also lets us formalize guarantees that BaseViewManager may safely manipulate background styling of all built in native components. There is one still known issue, where BackgroundStyleApplicator does not propagate I18nManager derived layout direction to borders (compared to Android derived root direction). This is mostly an issue for apps that with LTR and RTL context, or force a layout direction, which I would guess is relatively rare, so my plan is to forward fix this later this by enabling set_android_layout_direction which will solve that problem mopre generically. Changelog: [Internal] Reviewed By: cortinico Differential Revision: D61658083 fbshipit-source-id: b753d4eb45091aa31ea870a684c35b71c1ee5036 --- .../text/ReactTextAnchorViewManager.java | 63 ++++------------- .../react/views/text/ReactTextView.java | 68 +++++-------------- 2 files changed, 30 insertions(+), 101 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java index 7149f570d17..cd8759120e5 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java @@ -18,12 +18,10 @@ import androidx.annotation.Nullable; import com.facebook.common.logging.FLog; import com.facebook.react.bridge.ReadableArray; import com.facebook.react.common.ReactConstants; -import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags; import com.facebook.react.uimanager.BackgroundStyleApplicator; import com.facebook.react.uimanager.BaseViewManager; import com.facebook.react.uimanager.LengthPercentage; import com.facebook.react.uimanager.LengthPercentageType; -import com.facebook.react.uimanager.PixelUtil; import com.facebook.react.uimanager.Spacing; import com.facebook.react.uimanager.ViewDefaults; import com.facebook.react.uimanager.ViewProps; @@ -153,36 +151,20 @@ public abstract class ReactTextAnchorViewManager