You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
De-duplicate building Spannable on Android (#39630)
Summary:
A first step in my work on react-native-community/discussions-and-proposals#695
De-duplicate the code for creating `Spannable` on Android. I'm planning to add quite serious new features to this module. This would be really hard with the current level of code duplication.
## Changelog:
[INTERNAL] [CHANGED] - De-duplicate building `Spannable` on Android
Pull Request resolved: #39630
Test Plan: I tried to ensure that the refactored code is relatively easy to prove to be equivalent to the original duplicated one, but there's always a risk of a human mistake in this process. So far, I have been testing this by ensuring that nothing broke in the `Text` example section in RNTester.
Reviewed By: mdvacca
Differential Revision: D51016244
Pulled By: NickGerleman
fbshipit-source-id: e9f873c01b2af0685c7b0943aebea170c997d22e
Copy file name to clipboardExpand all lines: packages/react-native/ReactAndroid/api/ReactAndroid.api
+46-5Lines changed: 46 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1686,6 +1686,7 @@ public final class com/facebook/react/common/MapBuilder$Builder {
1686
1686
1687
1687
public class com/facebook/react/common/ReactConstants {
1688
1688
public static final field TAG Ljava/lang/String;
1689
+
public static final field UNSET I
1689
1690
public fun <init> ()V
1690
1691
}
1691
1692
@@ -1764,7 +1765,6 @@ public class com/facebook/react/common/assets/ReactFontManager {
1764
1765
public class com/facebook/react/common/assets/ReactFontManager$TypefaceStyle {
1765
1766
public static final field BOLD I
1766
1767
public static final field NORMAL I
1767
-
public static final field UNSET I
1768
1768
public fun <init> (I)V
1769
1769
public fun <init> (II)V
1770
1770
public fun <init> (IZ)V
@@ -1906,6 +1906,7 @@ public class com/facebook/react/config/ReactFeatureFlags {
1906
1906
public static field enableMountHooks Z
1907
1907
public static field enableOnDemandReactChoreographer Z
1908
1908
public static field enableRemoveDeleteTreeInstruction Z
1909
+
public static field enableSpannableBuildingUnification Z
1909
1910
public static field enableTextSpannableCache Z
1910
1911
public static field enableViewRecycling Z
1911
1912
public static field excludeYogaFromRawProps Z
@@ -6785,15 +6786,14 @@ public class com/facebook/react/views/text/ReactBackgroundColorSpan : android/te
6785
6786
public fun <init> (I)V
6786
6787
}
6787
6788
6788
-
public abstract class com/facebook/react/views/text/ReactBaseTextShadowNode : com/facebook/react/uimanager/LayoutShadowNode {
6789
+
public abstract class com/facebook/react/views/text/ReactBaseTextShadowNode : com/facebook/react/uimanager/LayoutShadowNode, com/facebook/react/views/text/BasicTextAttributeProvider {
6789
6790
public static final field DEFAULT_TEXT_SHADOW_COLOR I
6790
6791
public static final field PROP_SHADOW_COLOR Ljava/lang/String;
6791
6792
public static final field PROP_SHADOW_OFFSET Ljava/lang/String;
6792
6793
public static final field PROP_SHADOW_OFFSET_HEIGHT Ljava/lang/String;
6793
6794
public static final field PROP_SHADOW_OFFSET_WIDTH Ljava/lang/String;
6794
6795
public static final field PROP_SHADOW_RADIUS Ljava/lang/String;
6795
6796
public static final field PROP_TEXT_TRANSFORM Ljava/lang/String;
6796
-
public static final field UNSET I
6797
6797
protected field mAccessibilityRole Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$AccessibilityRole;
6798
6798
protected field mAdjustsFontSizeToFit Z
6799
6799
protected field mBackgroundColor I
@@ -6824,6 +6824,22 @@ public abstract class com/facebook/react/views/text/ReactBaseTextShadowNode : co
6824
6824
protected field mTextShadowRadius F
6825
6825
public fun <init> ()V
6826
6826
public fun <init> (Lcom/facebook/react/views/text/ReactTextViewManagerCallback;)V
6827
+
public fun getAccessibilityRole ()Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$AccessibilityRole;
6828
+
public fun getBackgroundColor ()I
6829
+
public fun getColor ()I
6830
+
public fun getFontFamily ()Ljava/lang/String;
6831
+
public fun getFontFeatureSettings ()Ljava/lang/String;
6832
+
public fun getFontStyle ()I
6833
+
public fun getFontWeight ()I
6834
+
public fun getRole ()Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$Role;
6835
+
public fun getTextShadowColor ()I
6836
+
public fun getTextShadowOffsetDx ()F
6837
+
public fun getTextShadowOffsetDy ()F
6838
+
public fun getTextShadowRadius ()F
6839
+
public fun isBackgroundColorSet ()Z
6840
+
public fun isColorSet ()Z
6841
+
public fun isLineThroughTextDecorationSet ()Z
6842
+
public fun isUnderlineTextDecorationSet ()Z
6827
6843
public fun setAccessibilityRole (Ljava/lang/String;)V
6828
6844
public fun setAdjustFontSizeToFit (Z)V
6829
6845
public fun setAllowFontScaling (Z)V
@@ -7084,12 +7100,19 @@ public class com/facebook/react/views/text/ReactVirtualTextViewManager$$PropsSet
7084
7100
public fun setProperty (Lcom/facebook/react/views/text/ReactVirtualTextViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
7085
7101
}
7086
7102
7103
+
public class com/facebook/react/views/text/SetSpanOperation {
7104
+
protected field end I
7105
+
protected field start I
7106
+
protected field what Lcom/facebook/react/views/text/ReactSpan;
7107
+
public fun execute (Landroid/text/SpannableStringBuilder;I)V
7108
+
}
7109
+
7087
7110
public class com/facebook/react/views/text/ShadowStyleSpan : android/text/style/CharacterStyle, com/facebook/react/views/text/ReactSpan {
7088
7111
public fun <init> (FFFI)V
7089
7112
public fun updateDrawState (Landroid/text/TextPaint;)V
7090
7113
}
7091
7114
7092
-
public class com/facebook/react/views/text/TextAttributeProps {
7115
+
public class com/facebook/react/views/text/TextAttributeProps : com/facebook/react/views/text/EffectiveTextAttributeProvider {
7093
7116
public static final field TA_KEY_ACCESSIBILITY_ROLE S
7094
7117
public static final field TA_KEY_ALIGNMENT S
7095
7118
public static final field TA_KEY_ALLOW_FONT_SCALING S
@@ -7117,7 +7140,6 @@ public class com/facebook/react/views/text/TextAttributeProps {
7117
7140
public static final field TA_KEY_TEXT_SHADOW_OFFSET_DY S
7118
7141
public static final field TA_KEY_TEXT_SHADOW_RADIUS S
7119
7142
public static final field TA_KEY_TEXT_TRANSFORM S
7120
-
public static final field UNSET I
7121
7143
protected field mAccessibilityRole Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$AccessibilityRole;
7122
7144
protected field mAllowFontScaling Z
7123
7145
protected field mBackgroundColor I
@@ -7149,13 +7171,32 @@ public class com/facebook/react/views/text/TextAttributeProps {
7149
7171
protected field mTextTransform Lcom/facebook/react/views/text/TextTransform;
7150
7172
public static fun fromMapBuffer (Lcom/facebook/react/common/mapbuffer/MapBuffer;)Lcom/facebook/react/views/text/TextAttributeProps;
7151
7173
public static fun fromReadableMap (Lcom/facebook/react/uimanager/ReactStylesDiffMap;)Lcom/facebook/react/views/text/TextAttributeProps;
7174
+
public fun getAccessibilityRole ()Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$AccessibilityRole;
7175
+
public fun getBackgroundColor ()I
7176
+
public fun getColor ()I
7177
+
public fun getEffectiveFontSize ()I
7178
+
public fun getEffectiveLetterSpacing ()F
7152
7179
public fun getEffectiveLineHeight ()F
7180
+
public fun getFontFamily ()Ljava/lang/String;
7181
+
public fun getFontFeatureSettings ()Ljava/lang/String;
7182
+
public fun getFontStyle ()I
7183
+
public fun getFontWeight ()I
7153
7184
public static fun getHyphenationFrequency (Ljava/lang/String;)I
7154
7185
public static fun getJustificationMode (Lcom/facebook/react/uimanager/ReactStylesDiffMap;I)I
7155
7186
public static fun getLayoutDirection (Ljava/lang/String;)I
7156
7187
public fun getLetterSpacing ()F
7188
+
public fun getRole ()Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$Role;
7157
7189
public static fun getTextAlignment (Lcom/facebook/react/uimanager/ReactStylesDiffMap;ZI)I
7158
7190
public static fun getTextBreakStrategy (Ljava/lang/String;)I
7191
+
public fun getTextShadowColor ()I
7192
+
public fun getTextShadowOffsetDx ()F
7193
+
public fun getTextShadowOffsetDy ()F
7194
+
public fun getTextShadowRadius ()F
7195
+
public fun getTextTransform ()Lcom/facebook/react/views/text/TextTransform;
7196
+
public fun isBackgroundColorSet ()Z
7197
+
public fun isColorSet ()Z
7198
+
public fun isLineThroughTextDecorationSet ()Z
7199
+
public fun isUnderlineTextDecorationSet ()Z
7159
7200
}
7160
7201
7161
7202
public class com/facebook/react/views/text/TextAttributes {
0 commit comments