react-native 0.70.8 → 0.70.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/Libraries/Core/ReactNativeVersion.js +1 -1
  2. package/React/Base/RCTVersion.m +1 -1
  3. package/ReactAndroid/gradle.properties +1 -1
  4. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  5. package/ReactAndroid/src/main/java/com/facebook/react/views/text/CustomLetterSpacingSpan.java +4 -0
  6. package/ReactAndroid/src/main/java/com/facebook/react/views/text/CustomStyleSpan.java +4 -0
  7. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextUpdate.java +1 -5
  8. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +9 -7
  9. package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.java +13 -5
  10. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +15 -15
  11. package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManagerMapBuffer.java +5 -0
  12. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/BUCK +9 -3
  13. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java +204 -117
  14. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +78 -11
  15. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundManager.java +5 -0
  16. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  17. package/ReactCommon/react/renderer/components/text/ParagraphState.h +9 -0
  18. package/ReactCommon/react/renderer/components/text/conversions.h +1 -9
  19. package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputState.cpp +22 -0
  20. package/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputState.h +1 -3
  21. package/android/com/facebook/react/hermes-engine/0.70.9/hermes-engine-0.70.9-debug.aar +0 -0
  22. package/android/com/facebook/react/hermes-engine/0.70.9/hermes-engine-0.70.9-debug.aar.md5 +1 -0
  23. package/android/com/facebook/react/hermes-engine/0.70.9/hermes-engine-0.70.9-debug.aar.sha1 +1 -0
  24. package/android/com/facebook/react/hermes-engine/0.70.9/hermes-engine-0.70.9-debug.aar.sha256 +1 -0
  25. package/android/com/facebook/react/hermes-engine/0.70.9/hermes-engine-0.70.9-debug.aar.sha512 +1 -0
  26. package/android/com/facebook/react/hermes-engine/0.70.9/hermes-engine-0.70.9-release.aar +0 -0
  27. package/android/com/facebook/react/hermes-engine/0.70.9/hermes-engine-0.70.9-release.aar.md5 +1 -0
  28. package/android/com/facebook/react/hermes-engine/0.70.9/hermes-engine-0.70.9-release.aar.sha1 +1 -0
  29. package/android/com/facebook/react/hermes-engine/0.70.9/hermes-engine-0.70.9-release.aar.sha256 +1 -0
  30. package/android/com/facebook/react/hermes-engine/0.70.9/hermes-engine-0.70.9-release.aar.sha512 +1 -0
  31. package/android/com/facebook/react/hermes-engine/{0.70.8/hermes-engine-0.70.8.module → 0.70.9/hermes-engine-0.70.9.module} +33 -33
  32. package/android/com/facebook/react/hermes-engine/0.70.9/hermes-engine-0.70.9.module.md5 +1 -0
  33. package/android/com/facebook/react/hermes-engine/0.70.9/hermes-engine-0.70.9.module.sha1 +1 -0
  34. package/android/com/facebook/react/hermes-engine/0.70.9/hermes-engine-0.70.9.module.sha256 +1 -0
  35. package/android/com/facebook/react/hermes-engine/0.70.9/hermes-engine-0.70.9.module.sha512 +1 -0
  36. package/android/com/facebook/react/hermes-engine/{0.70.8/hermes-engine-0.70.8.pom → 0.70.9/hermes-engine-0.70.9.pom} +1 -1
  37. package/android/com/facebook/react/hermes-engine/0.70.9/hermes-engine-0.70.9.pom.md5 +1 -0
  38. package/android/com/facebook/react/hermes-engine/0.70.9/hermes-engine-0.70.9.pom.sha1 +1 -0
  39. package/android/com/facebook/react/hermes-engine/0.70.9/hermes-engine-0.70.9.pom.sha256 +1 -0
  40. package/android/com/facebook/react/hermes-engine/0.70.9/hermes-engine-0.70.9.pom.sha512 +1 -0
  41. package/android/com/facebook/react/hermes-engine/maven-metadata.xml +4 -4
  42. package/android/com/facebook/react/hermes-engine/maven-metadata.xml.md5 +1 -1
  43. package/android/com/facebook/react/hermes-engine/maven-metadata.xml.sha1 +1 -1
  44. package/android/com/facebook/react/hermes-engine/maven-metadata.xml.sha256 +1 -1
  45. package/android/com/facebook/react/hermes-engine/maven-metadata.xml.sha512 +1 -1
  46. package/android/com/facebook/react/react-native/{0.70.8/react-native-0.70.8-debug-sources.jar → 0.70.9/react-native-0.70.9-debug-sources.jar} +0 -0
  47. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9-debug-sources.jar.md5 +1 -0
  48. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9-debug-sources.jar.sha1 +1 -0
  49. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9-debug-sources.jar.sha256 +1 -0
  50. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9-debug-sources.jar.sha512 +1 -0
  51. package/android/com/facebook/react/react-native/{0.70.8/react-native-0.70.8-debug.aar → 0.70.9/react-native-0.70.9-debug.aar} +0 -0
  52. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9-debug.aar.md5 +1 -0
  53. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9-debug.aar.sha1 +1 -0
  54. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9-debug.aar.sha256 +1 -0
  55. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9-debug.aar.sha512 +1 -0
  56. package/android/com/facebook/react/react-native/{0.70.8/react-native-0.70.8-release-sources.jar → 0.70.9/react-native-0.70.9-release-sources.jar} +0 -0
  57. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9-release-sources.jar.md5 +1 -0
  58. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9-release-sources.jar.sha1 +1 -0
  59. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9-release-sources.jar.sha256 +1 -0
  60. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9-release-sources.jar.sha512 +1 -0
  61. package/android/com/facebook/react/react-native/{0.70.8/react-native-0.70.8-release.aar → 0.70.9/react-native-0.70.9-release.aar} +0 -0
  62. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9-release.aar.md5 +1 -0
  63. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9-release.aar.sha1 +1 -0
  64. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9-release.aar.sha256 +1 -0
  65. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9-release.aar.sha512 +1 -0
  66. package/android/com/facebook/react/react-native/{0.70.8/react-native-0.70.8.module → 0.70.9/react-native-0.70.9.module} +43 -43
  67. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9.module.md5 +1 -0
  68. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9.module.sha1 +1 -0
  69. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9.module.sha256 +1 -0
  70. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9.module.sha512 +1 -0
  71. package/android/com/facebook/react/react-native/{0.70.8/react-native-0.70.8.pom → 0.70.9/react-native-0.70.9.pom} +1 -1
  72. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9.pom.md5 +1 -0
  73. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9.pom.sha1 +1 -0
  74. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9.pom.sha256 +1 -0
  75. package/android/com/facebook/react/react-native/0.70.9/react-native-0.70.9.pom.sha512 +1 -0
  76. package/android/com/facebook/react/react-native/maven-metadata.xml +4 -4
  77. package/android/com/facebook/react/react-native/maven-metadata.xml.md5 +1 -1
  78. package/android/com/facebook/react/react-native/maven-metadata.xml.sha1 +1 -1
  79. package/android/com/facebook/react/react-native/maven-metadata.xml.sha256 +1 -1
  80. package/android/com/facebook/react/react-native/maven-metadata.xml.sha512 +1 -1
  81. package/package.json +2 -1
  82. package/sdks/.hermesversion +1 -1
  83. package/sdks/hermesc/osx-bin/hermesc +0 -0
  84. package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
  85. package/template/package.json +1 -1
  86. package/android/com/facebook/react/hermes-engine/0.70.8/hermes-engine-0.70.8-debug.aar +0 -0
  87. package/android/com/facebook/react/hermes-engine/0.70.8/hermes-engine-0.70.8-debug.aar.md5 +0 -1
  88. package/android/com/facebook/react/hermes-engine/0.70.8/hermes-engine-0.70.8-debug.aar.sha1 +0 -1
  89. package/android/com/facebook/react/hermes-engine/0.70.8/hermes-engine-0.70.8-debug.aar.sha256 +0 -1
  90. package/android/com/facebook/react/hermes-engine/0.70.8/hermes-engine-0.70.8-debug.aar.sha512 +0 -1
  91. package/android/com/facebook/react/hermes-engine/0.70.8/hermes-engine-0.70.8-release.aar +0 -0
  92. package/android/com/facebook/react/hermes-engine/0.70.8/hermes-engine-0.70.8-release.aar.md5 +0 -1
  93. package/android/com/facebook/react/hermes-engine/0.70.8/hermes-engine-0.70.8-release.aar.sha1 +0 -1
  94. package/android/com/facebook/react/hermes-engine/0.70.8/hermes-engine-0.70.8-release.aar.sha256 +0 -1
  95. package/android/com/facebook/react/hermes-engine/0.70.8/hermes-engine-0.70.8-release.aar.sha512 +0 -1
  96. package/android/com/facebook/react/hermes-engine/0.70.8/hermes-engine-0.70.8.module.md5 +0 -1
  97. package/android/com/facebook/react/hermes-engine/0.70.8/hermes-engine-0.70.8.module.sha1 +0 -1
  98. package/android/com/facebook/react/hermes-engine/0.70.8/hermes-engine-0.70.8.module.sha256 +0 -1
  99. package/android/com/facebook/react/hermes-engine/0.70.8/hermes-engine-0.70.8.module.sha512 +0 -1
  100. package/android/com/facebook/react/hermes-engine/0.70.8/hermes-engine-0.70.8.pom.md5 +0 -1
  101. package/android/com/facebook/react/hermes-engine/0.70.8/hermes-engine-0.70.8.pom.sha1 +0 -1
  102. package/android/com/facebook/react/hermes-engine/0.70.8/hermes-engine-0.70.8.pom.sha256 +0 -1
  103. package/android/com/facebook/react/hermes-engine/0.70.8/hermes-engine-0.70.8.pom.sha512 +0 -1
  104. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8-debug-sources.jar.md5 +0 -1
  105. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8-debug-sources.jar.sha1 +0 -1
  106. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8-debug-sources.jar.sha256 +0 -1
  107. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8-debug-sources.jar.sha512 +0 -1
  108. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8-debug.aar.md5 +0 -1
  109. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8-debug.aar.sha1 +0 -1
  110. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8-debug.aar.sha256 +0 -1
  111. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8-debug.aar.sha512 +0 -1
  112. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8-release-sources.jar.md5 +0 -1
  113. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8-release-sources.jar.sha1 +0 -1
  114. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8-release-sources.jar.sha256 +0 -1
  115. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8-release-sources.jar.sha512 +0 -1
  116. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8-release.aar.md5 +0 -1
  117. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8-release.aar.sha1 +0 -1
  118. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8-release.aar.sha256 +0 -1
  119. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8-release.aar.sha512 +0 -1
  120. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8.module.md5 +0 -1
  121. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8.module.sha1 +0 -1
  122. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8.module.sha256 +0 -1
  123. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8.module.sha512 +0 -1
  124. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8.pom.md5 +0 -1
  125. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8.pom.sha1 +0 -1
  126. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8.pom.sha256 +0 -1
  127. package/android/com/facebook/react/react-native/0.70.8/react-native-0.70.8.pom.sha512 +0 -1
  128. /package/android/com/facebook/react/hermes-engine/{0.70.8/hermes-engine-0.70.8-debug-sources.jar → 0.70.9/hermes-engine-0.70.9-debug-sources.jar} +0 -0
  129. /package/android/com/facebook/react/hermes-engine/{0.70.8/hermes-engine-0.70.8-debug-sources.jar.md5 → 0.70.9/hermes-engine-0.70.9-debug-sources.jar.md5} +0 -0
  130. /package/android/com/facebook/react/hermes-engine/{0.70.8/hermes-engine-0.70.8-debug-sources.jar.sha1 → 0.70.9/hermes-engine-0.70.9-debug-sources.jar.sha1} +0 -0
  131. /package/android/com/facebook/react/hermes-engine/{0.70.8/hermes-engine-0.70.8-debug-sources.jar.sha256 → 0.70.9/hermes-engine-0.70.9-debug-sources.jar.sha256} +0 -0
  132. /package/android/com/facebook/react/hermes-engine/{0.70.8/hermes-engine-0.70.8-debug-sources.jar.sha512 → 0.70.9/hermes-engine-0.70.9-debug-sources.jar.sha512} +0 -0
  133. /package/android/com/facebook/react/hermes-engine/{0.70.8/hermes-engine-0.70.8-release-sources.jar → 0.70.9/hermes-engine-0.70.9-release-sources.jar} +0 -0
  134. /package/android/com/facebook/react/hermes-engine/{0.70.8/hermes-engine-0.70.8-release-sources.jar.md5 → 0.70.9/hermes-engine-0.70.9-release-sources.jar.md5} +0 -0
  135. /package/android/com/facebook/react/hermes-engine/{0.70.8/hermes-engine-0.70.8-release-sources.jar.sha1 → 0.70.9/hermes-engine-0.70.9-release-sources.jar.sha1} +0 -0
  136. /package/android/com/facebook/react/hermes-engine/{0.70.8/hermes-engine-0.70.8-release-sources.jar.sha256 → 0.70.9/hermes-engine-0.70.9-release-sources.jar.sha256} +0 -0
  137. /package/android/com/facebook/react/hermes-engine/{0.70.8/hermes-engine-0.70.8-release-sources.jar.sha512 → 0.70.9/hermes-engine-0.70.9-release-sources.jar.sha512} +0 -0
@@ -12,6 +12,6 @@
12
12
  exports.version = {
13
13
  major: 0,
14
14
  minor: 70,
15
- patch: 8,
15
+ patch: 9,
16
16
  prerelease: null,
17
17
  };
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(70),
26
- RCTVersionPatch: @(8),
26
+ RCTVersionPatch: @(9),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.70.8
1
+ VERSION_NAME=0.70.9
2
2
  GROUP=com.facebook.react
3
3
 
4
4
  POM_NAME=ReactNative
@@ -17,6 +17,6 @@ public class ReactNativeVersion {
17
17
  public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
18
18
  "major", 0,
19
19
  "minor", 70,
20
- "patch", 8,
20
+ "patch", 9,
21
21
  "prerelease", null);
22
22
  }
@@ -37,6 +37,10 @@ public class CustomLetterSpacingSpan extends MetricAffectingSpan implements Reac
37
37
  apply(paint);
38
38
  }
39
39
 
40
+ public float getSpacing() {
41
+ return mLetterSpacing;
42
+ }
43
+
40
44
  private void apply(TextPaint paint) {
41
45
  if (!Float.isNaN(mLetterSpacing)) {
42
46
  paint.setLetterSpacing(mLetterSpacing);
@@ -71,6 +71,10 @@ public class CustomStyleSpan extends MetricAffectingSpan implements ReactSpan {
71
71
  return mFontFamily;
72
72
  }
73
73
 
74
+ public @Nullable String getFontFeatureSettings() {
75
+ return mFeatureSettings;
76
+ }
77
+
74
78
  private static void apply(
75
79
  Paint paint,
76
80
  int style,
@@ -31,8 +31,6 @@ public class ReactTextUpdate {
31
31
  private final int mSelectionEnd;
32
32
  private final int mJustificationMode;
33
33
 
34
- public boolean mContainsMultipleFragments;
35
-
36
34
  /**
37
35
  * @deprecated Use a non-deprecated constructor for ReactTextUpdate instead. This one remains
38
36
  * because it's being used by a unit test that isn't currently open source.
@@ -142,13 +140,11 @@ public class ReactTextUpdate {
142
140
  int jsEventCounter,
143
141
  int textAlign,
144
142
  int textBreakStrategy,
145
- int justificationMode,
146
- boolean containsMultipleFragments) {
143
+ int justificationMode) {
147
144
 
148
145
  ReactTextUpdate reactTextUpdate =
149
146
  new ReactTextUpdate(
150
147
  text, jsEventCounter, false, textAlign, textBreakStrategy, justificationMode);
151
- reactTextUpdate.mContainsMultipleFragments = containsMultipleFragments;
152
148
  return reactTextUpdate;
153
149
  }
154
150
 
@@ -54,7 +54,6 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
54
54
  private boolean mContainsImages;
55
55
  private final int mDefaultGravityHorizontal;
56
56
  private final int mDefaultGravityVertical;
57
- private int mTextAlign;
58
57
  private int mNumberOfLines;
59
58
  private TextUtils.TruncateAt mEllipsizeLocation;
60
59
  private boolean mAdjustsFontSizeToFit;
@@ -69,8 +68,7 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
69
68
  super(context);
70
69
 
71
70
  // Get these defaults only during the constructor - these should never be set otherwise
72
- mDefaultGravityHorizontal =
73
- getGravity() & (Gravity.HORIZONTAL_GRAVITY_MASK | Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK);
71
+ mDefaultGravityHorizontal = getGravityHorizontal();
74
72
  mDefaultGravityVertical = getGravity() & Gravity.VERTICAL_GRAVITY_MASK;
75
73
 
76
74
  initView();
@@ -89,10 +87,10 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
89
87
 
90
88
  mReactBackgroundManager = new ReactViewBackgroundManager(this);
91
89
 
92
- mTextAlign = Gravity.NO_GRAVITY;
93
90
  mNumberOfLines = ViewDefaults.NUMBER_OF_LINES;
94
91
  mAdjustsFontSizeToFit = false;
95
92
  mLinkifyMaskType = 0;
93
+ mNotifyOnInlineViewLayout = false;
96
94
  mTextIsSelectable = false;
97
95
  mEllipsizeLocation = TextUtils.TruncateAt.END;
98
96
 
@@ -392,10 +390,9 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
392
390
  }
393
391
 
394
392
  int nextTextAlign = update.getTextAlign();
395
- if (mTextAlign != nextTextAlign) {
396
- mTextAlign = nextTextAlign;
393
+ if (nextTextAlign != getGravityHorizontal()) {
394
+ setGravityHorizontal(nextTextAlign);
397
395
  }
398
- setGravityHorizontal(mTextAlign);
399
396
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
400
397
  if (getBreakStrategy() != update.getTextBreakStrategy()) {
401
398
  setBreakStrategy(update.getTextBreakStrategy());
@@ -552,6 +549,11 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
552
549
  return false;
553
550
  }
554
551
 
552
+ /* package */ int getGravityHorizontal() {
553
+ return getGravity()
554
+ & (Gravity.HORIZONTAL_GRAVITY_MASK | Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK);
555
+ }
556
+
555
557
  /* package */ void setGravityHorizontal(int gravityHorizontal) {
556
558
  if (gravityHorizontal == 0) {
557
559
  gravityHorizontal = mDefaultGravityHorizontal;
@@ -8,6 +8,7 @@
8
8
  package com.facebook.react.views.text;
9
9
 
10
10
  import android.content.Context;
11
+ import android.os.Build;
11
12
  import android.text.Spannable;
12
13
  import androidx.annotation.NonNull;
13
14
  import androidx.annotation.Nullable;
@@ -24,6 +25,7 @@ import com.facebook.react.uimanager.ReactAccessibilityDelegate;
24
25
  import com.facebook.react.uimanager.ReactStylesDiffMap;
25
26
  import com.facebook.react.uimanager.StateWrapper;
26
27
  import com.facebook.react.uimanager.ThemedReactContext;
28
+ import com.facebook.react.uimanager.ViewProps;
27
29
  import com.facebook.yoga.YogaMeasureMode;
28
30
  import java.util.HashMap;
29
31
  import java.util.Map;
@@ -152,15 +154,19 @@ public class ReactTextViewManager
152
154
  view.setSpanned(spanned);
153
155
 
154
156
  int textBreakStrategy =
155
- TextAttributeProps.getTextBreakStrategy(paragraphAttributes.getString("textBreakStrategy"));
157
+ TextAttributeProps.getTextBreakStrategy(
158
+ paragraphAttributes.getString(ViewProps.TEXT_BREAK_STRATEGY));
159
+ int currentJustificationMode =
160
+ Build.VERSION.SDK_INT < Build.VERSION_CODES.O ? 0 : view.getJustificationMode();
156
161
 
157
162
  return new ReactTextUpdate(
158
163
  spanned,
159
164
  state.hasKey("mostRecentEventCount") ? state.getInt("mostRecentEventCount") : -1,
160
165
  false, // TODO add this into local Data
161
- TextAttributeProps.getTextAlignment(props, TextLayoutManager.isRTL(attributedString)),
166
+ TextAttributeProps.getTextAlignment(
167
+ props, TextLayoutManager.isRTL(attributedString), view.getGravityHorizontal()),
162
168
  textBreakStrategy,
163
- TextAttributeProps.getJustificationMode(props));
169
+ TextAttributeProps.getJustificationMode(props, currentJustificationMode));
164
170
  }
165
171
 
166
172
  private Object getReactTextUpdate(ReactTextView view, ReactStylesDiffMap props, MapBuffer state) {
@@ -175,15 +181,17 @@ public class ReactTextViewManager
175
181
  int textBreakStrategy =
176
182
  TextAttributeProps.getTextBreakStrategy(
177
183
  paragraphAttributes.getString(TextLayoutManagerMapBuffer.PA_KEY_TEXT_BREAK_STRATEGY));
184
+ int currentJustificationMode =
185
+ Build.VERSION.SDK_INT < Build.VERSION_CODES.O ? 0 : view.getJustificationMode();
178
186
 
179
187
  return new ReactTextUpdate(
180
188
  spanned,
181
189
  -1, // UNUSED FOR TEXT
182
190
  false, // TODO add this into local Data
183
191
  TextAttributeProps.getTextAlignment(
184
- props, TextLayoutManagerMapBuffer.isRTL(attributedString)),
192
+ props, TextLayoutManagerMapBuffer.isRTL(attributedString), view.getGravityHorizontal()),
185
193
  textBreakStrategy,
186
- TextAttributeProps.getJustificationMode(props));
194
+ TextAttributeProps.getJustificationMode(props, currentJustificationMode));
187
195
  }
188
196
 
189
197
  @Override
@@ -249,35 +249,35 @@ public class TextAttributeProps {
249
249
  return result;
250
250
  }
251
251
 
252
- public static int getTextAlignment(ReactStylesDiffMap props, boolean isRTL) {
253
- @Nullable
254
- String textAlignPropValue =
255
- props.hasKey(ViewProps.TEXT_ALIGN) ? props.getString(ViewProps.TEXT_ALIGN) : null;
256
- int textAlignment;
252
+ public static int getTextAlignment(ReactStylesDiffMap props, boolean isRTL, int defaultValue) {
253
+ if (!props.hasKey(ViewProps.TEXT_ALIGN)) {
254
+ return defaultValue;
255
+ }
257
256
 
257
+ String textAlignPropValue = props.getString(ViewProps.TEXT_ALIGN);
258
258
  if ("justify".equals(textAlignPropValue)) {
259
- textAlignment = Gravity.LEFT;
259
+ return Gravity.LEFT;
260
260
  } else {
261
261
  if (textAlignPropValue == null || "auto".equals(textAlignPropValue)) {
262
- textAlignment = Gravity.NO_GRAVITY;
262
+ return Gravity.NO_GRAVITY;
263
263
  } else if ("left".equals(textAlignPropValue)) {
264
- textAlignment = isRTL ? Gravity.RIGHT : Gravity.LEFT;
264
+ return isRTL ? Gravity.RIGHT : Gravity.LEFT;
265
265
  } else if ("right".equals(textAlignPropValue)) {
266
- textAlignment = isRTL ? Gravity.LEFT : Gravity.RIGHT;
266
+ return isRTL ? Gravity.LEFT : Gravity.RIGHT;
267
267
  } else if ("center".equals(textAlignPropValue)) {
268
- textAlignment = Gravity.CENTER_HORIZONTAL;
268
+ return Gravity.CENTER_HORIZONTAL;
269
269
  } else {
270
270
  throw new JSApplicationIllegalArgumentException("Invalid textAlign: " + textAlignPropValue);
271
271
  }
272
272
  }
273
- return textAlignment;
274
273
  }
275
274
 
276
- public static int getJustificationMode(ReactStylesDiffMap props) {
277
- @Nullable
278
- String textAlignPropValue =
279
- props.hasKey(ViewProps.TEXT_ALIGN) ? props.getString(ViewProps.TEXT_ALIGN) : null;
275
+ public static int getJustificationMode(ReactStylesDiffMap props, int defaultValue) {
276
+ if (!props.hasKey(ViewProps.TEXT_ALIGN)) {
277
+ return defaultValue;
278
+ }
280
279
 
280
+ String textAlignPropValue = props.getString(ViewProps.TEXT_ALIGN);
281
281
  if ("justify".equals(textAlignPropValue) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
282
282
  return Layout.JUSTIFICATION_MODE_INTER_WORD;
283
283
  }
@@ -106,6 +106,11 @@ public class TextLayoutManagerMapBuffer {
106
106
 
107
107
  MapBuffer fragment = fragments.getMapBuffer((short) 0);
108
108
  MapBuffer textAttributes = fragment.getMapBuffer(FR_KEY_TEXT_ATTRIBUTES);
109
+
110
+ if (!textAttributes.contains(TextAttributeProps.TA_KEY_LAYOUT_DIRECTION)) {
111
+ return false;
112
+ }
113
+
109
114
  return TextAttributeProps.getLayoutDirection(
110
115
  textAttributes.getString(TextAttributeProps.TA_KEY_LAYOUT_DIRECTION))
111
116
  == LayoutDirection.RTL;
@@ -1,4 +1,7 @@
1
- load("//tools/build_defs/oss:rn_defs.bzl", "YOGA_TARGET", "react_native_dep", "react_native_target", "rn_android_library")
1
+ load("//tools/build_defs/oss:rn_defs.bzl", "IS_OSS_BUILD", "YOGA_TARGET", "react_native_android_toplevel_dep", "react_native_dep", "react_native_target", "rn_android_library")
2
+
3
+ # TODO(T115916830): Remove when Kotlin files are used in this module
4
+ KOTLIN_STDLIB_DEPS = [react_native_android_toplevel_dep("third-party/kotlin:kotlin-stdlib")] if IS_OSS_BUILD else []
2
5
 
3
6
  rn_android_library(
4
7
  name = "textinput",
@@ -9,7 +12,8 @@ rn_android_library(
9
12
  "pfh:ReactNative_CommonInfrastructurePlaceholder",
10
13
  "supermodule:xplat/default/public.react_native.infra",
11
14
  ],
12
- language = "JAVA",
15
+ language = "KOTLIN",
16
+ pure_kotlin = False,
13
17
  required_for_source_only_abi = True,
14
18
  visibility = [
15
19
  "PUBLIC",
@@ -29,8 +33,10 @@ rn_android_library(
29
33
  react_native_target("java/com/facebook/react/views/imagehelper:imagehelper"),
30
34
  react_native_target("java/com/facebook/react/views/scroll:scroll"),
31
35
  react_native_target("java/com/facebook/react/views/text:text"),
36
+ react_native_target("java/com/facebook/react/common/mapbuffer:mapbuffer"),
32
37
  react_native_target("java/com/facebook/react/views/view:view"),
33
- ],
38
+ react_native_target("java/com/facebook/react/config:config"),
39
+ ] + KOTLIN_STDLIB_DEPS,
34
40
  exported_deps = [
35
41
  react_native_dep("third-party/android/androidx:appcompat"),
36
42
  ],