Skip to content

Commit f736393

Browse files
iray-tnometa-codesync[bot]
authored andcommitted
Add lineBreak and wordBreak props to Text on Android (#59002)
Summary: Android 13 (API 33) added [`LineBreakConfig`](https://developer.android.com/reference/android/graphics/text/LineBreakConfig), which controls two things CJK text needs and React Native cannot reach today: - **Line-break strictness** — CSS `line-break`. Strict kinsoku keeps characters such as small kana (`ッ`, `ャ`) and `ー` off the start of a line. - **Phrase-based breaking** — CSS `word-break: auto-phrase`. Japanese breaks at phrase (文節) boundaries instead of between any two characters, which reads much better in short lines such as buttons and headings. This cannot be done from a library. React Native builds the `StaticLayout` that both measures text for Yoga and is drawn, inside `TextLayoutManager`. A native module can only change the drawn `TextView`, which then disagrees with the measured height (clipped or extra lines). So the setting has to go through React Native's own text pipeline. This PR adds two `Text` props named after the CSS properties, documented as Android-only for now: ```ts lineBreak?: 'auto' | 'loose' | 'normal' | 'strict' // CSS line-break wordBreak?: 'normal' | 'auto-phrase' // CSS word-break ``` CSS values with no Android equivalent (`anywhere`, `keep-all`, `break-all`) are left out for now. - **JS / types:** `TextProps`, `TextNativeComponent` view config, `Text.d.ts`, regenerated `ReactNativeApi.d.ts`. - **C++:** `LineBreak` / `WordBreak` enums, conversions, `ParagraphAttributes` fields (equality, hash, debug props), `BaseParagraphProps` parsing, Android props diffing, and two new paragraph MapBuffer keys. C++ API snapshots regenerated. - **Android, measurement:** `TextLayoutManager` applies the config to the `StaticLayout.Builder` on API 33+. - **Android, drawing:** `ReactTextViewManager` `ReactProp` setters apply the same values to `ReactTextView`, so drawing matches measurement; recycled views reset them. **Behavior is unchanged unless the props are set.** With the defaults (`'auto'` / `'normal'`) no `LineBreakConfig` is set at all, and below API 33 the props are ignored. iOS has no equivalent API, so this is Android-only for now. `TextInput` is intentionally left out to keep the change reviewable. **`'auto-phrase'` depends on locale.** Per the [Android docs](https://developer.android.com/reference/android/graphics/text/LineBreakConfig#LINE_BREAK_WORD_STYLE_PHRASE), it has no effect in a locale without phrase-based breaking. Android `Text` is laid out in the device locale, so in practice it takes effect only when that locale supports it (e.g. Japanese). The prop docs say so. Naming follows review feedback: CSS names and values rather than `lineBreakStrategyAndroid`, since `lineBreakStrategyIOS` and `textBreakStrategy` control different things. Motivation and design notes: iray-tno/hozo#813 ## Changelog: [ANDROID] [ADDED] - Add `lineBreak` and `wordBreak` props to `Text` (CSS `line-break` / `word-break`) for strict/loose line breaking and phrase-based breaking on Android 13+ Pull Request resolved: #59002 Test Plan: Ran locally: - `yarn flow-check` — 0 errors - `yarn build-types` then `yarn test-generated-typescript` — passes - `yarn test` — 246 suites, 6154 tests passed - `yarn format-check-{javascript,cpp,kotlin,java}` — clean - ESLint on the changed JS files — clean - `yarn cxx-api-validate` (Doxygen 1.16.1, as in CI) — all 12 snapshots match Added: - C++ unit tests in `ParagraphAttributesTest.cpp` (equality/hash include the new fields, defaults are `Auto` / `Normal`, `toString` values match the JS prop values). - Updated the existing Robolectric tests that call `TextLayoutManager` internals for the new parameters. They pass the default values only, so they cover the plumbing, not the effect of `strict` / `auto-phrase`. - RNTester: **Text → Line break (lineBreak, wordBreak)** shows the same Japanese paragraph under each value at a fixed width, with a background so any measurement/drawing mismatch is visible. **Not run locally:** native compilation (Kotlin/Java/C++), the C++ and Robolectric unit tests, and an on-device check. The environment had no Android SDK and Gradle could not resolve its plugins. Relying on CI for the native build and tests. Still to verify on device, with the RNTester example: - [ ] API 33+, Japanese device locale: `lineBreak` (`strict` / `loose`) and `wordBreak="auto-phrase"` change the break positions - [ ] Measured height matches the drawn lines for each value (no clipped or blank lines) - [ ] Removing the prop returns to the default layout - [ ] A recycled `Text` does not keep a previous value - [ ] Non-Japanese device locale: `auto-phrase` has no effect, and nothing breaks - [ ] API 31/32: the props are ignored 🤖 Generated with [Claude Code](https://claude.com/claude-code) Reviewed By: andrewdacenko Differential Revision: D124966798 Pulled By: javache fbshipit-source-id: 5c66d1200b4b7af31adf3df5cc111f47996fec7f
1 parent a6c0c47 commit f736393

24 files changed

Lines changed: 497 additions & 4 deletions

File tree

‎packages/react-native/Libraries/Text/TextNativeComponent.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ const textViewConfig = {
4747
onTextLayout: true,
4848
dataDetectorType: true,
4949
android_hyphenationFrequency: true,
50+
lineBreak: true,
51+
wordBreak: true,
5052
lineBreakStrategyIOS: true,
5153
},
5254
directEventTypes: {

‎packages/react-native/Libraries/Text/TextProps.js‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,31 @@ type TextBaseProps = Readonly<{
149149
*/
150150
android_hyphenationFrequency?: ?('normal' | 'none' | 'full'),
151151

152+
/**
153+
* Sets the strictness of the line-breaking rules, such as which characters
154+
* may start or end a line in Chinese and Japanese text (kinsoku), as CSS
155+
* `line-break`. Currently Android only, and ignored below Android 13 (API
156+
* level 33).
157+
*
158+
* @default `'auto'`
159+
* @platform android
160+
*/
161+
lineBreak?: ?('auto' | 'loose' | 'normal' | 'strict'),
162+
163+
/**
164+
* Sets word-based line breaking, as CSS `word-break`. `'auto-phrase'` breaks
165+
* Japanese text at phrase boundaries instead of between any two characters.
166+
* Currently Android only, and ignored below Android 13 (API level 33).
167+
*
168+
* Support depends on the locale, and text is laid out in the device locale:
169+
* where that locale has no phrase-based breaking, `'auto-phrase'` has no
170+
* effect.
171+
*
172+
* @default `'normal'`
173+
* @platform android
174+
*/
175+
wordBreak?: ?('normal' | 'auto-phrase'),
176+
152177
children?: ?React.Node,
153178

154179
/**

‎packages/react-native/ReactAndroid/api/ReactAndroid.api‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6042,6 +6042,8 @@ public class com/facebook/react/views/text/ReactTextView : androidx/appcompat/wi
60426042
public fun setHyphenationFrequency (I)V
60436043
public fun setIncludeFontPadding (Z)V
60446044
public fun setLetterSpacing (F)V
6045+
public fun setLineBreakStyle (I)V
6046+
public fun setLineBreakWordStyle (I)V
60456047
public fun setLinkifyMask (I)V
60466048
public fun setMinimumFontScale (F)V
60476049
public fun setMinimumFontSize (F)V
@@ -6088,6 +6090,7 @@ public class com/facebook/react/views/text/ReactTextViewManager : com/facebook/r
60886090
public final fun setFontSize (Lcom/facebook/react/views/text/ReactTextView;F)V
60896091
public final fun setIncludeFontPadding (Lcom/facebook/react/views/text/ReactTextView;Z)V
60906092
public final fun setLetterSpacing (Lcom/facebook/react/views/text/ReactTextView;F)V
6093+
public final fun setLineBreak (Lcom/facebook/react/views/text/ReactTextView;Ljava/lang/String;)V
60916094
public final fun setNumberOfLines (Lcom/facebook/react/views/text/ReactTextView;I)V
60926095
public final fun setOverflow (Lcom/facebook/react/views/text/ReactTextView;Ljava/lang/String;)V
60936096
public synthetic fun setPadding (Landroid/view/View;IIII)V
@@ -6096,6 +6099,7 @@ public class com/facebook/react/views/text/ReactTextViewManager : com/facebook/r
60966099
public final fun setSelectable (Lcom/facebook/react/views/text/ReactTextView;Z)V
60976100
public final fun setSelectionColor (Lcom/facebook/react/views/text/ReactTextView;Ljava/lang/Integer;)V
60986101
public final fun setTextAlignVertical (Lcom/facebook/react/views/text/ReactTextView;Ljava/lang/String;)V
6102+
public final fun setWordBreak (Lcom/facebook/react/views/text/ReactTextView;Ljava/lang/String;)V
60996103
public synthetic fun updateExtraData (Landroid/view/View;Ljava/lang/Object;)V
61006104
public fun updateExtraData (Lcom/facebook/react/views/text/ReactTextView;Ljava/lang/Object;)V
61016105
public synthetic fun updateState (Landroid/view/View;Lcom/facebook/react/uimanager/ReactStylesDiffMap;Lcom/facebook/react/uimanager/StateWrapper;)Ljava/lang/Object;

‎packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77

88
package com.facebook.react.views.text;
99

10+
import android.annotation.SuppressLint;
1011
import android.content.Context;
1112
import android.graphics.Canvas;
1213
import android.graphics.Rect;
14+
import android.graphics.text.LineBreakConfig;
1315
import android.os.Build;
1416
import android.text.Layout;
1517
import android.text.Spannable;
@@ -26,6 +28,7 @@
2628
import android.view.ViewGroup;
2729
import android.widget.TextView;
2830
import androidx.annotation.Nullable;
31+
import androidx.annotation.RequiresApi;
2932
import androidx.appcompat.widget.AppCompatTextView;
3033
import androidx.core.view.AccessibilityDelegateCompat;
3134
import androidx.core.view.ViewCompat;
@@ -199,6 +202,10 @@ private void initView() {
199202
setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
200203

201204
setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_NONE);
205+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
206+
setLineBreakStyle(LineBreakConfig.LINE_BREAK_STYLE_NONE);
207+
setLineBreakWordStyle(LineBreakConfig.LINE_BREAK_WORD_STYLE_NONE);
208+
}
202209
updateView(); // call after changing ellipsizeLocation in particular
203210
}
204211

@@ -251,6 +258,8 @@ protected void onDraw(Canvas canvas) {
251258
getIncludeFontPadding(),
252259
getBreakStrategy(),
253260
getHyphenationFrequency(),
261+
getLineBreakStyleCompat(),
262+
getLineBreakWordStyleCompat(),
254263
// always passing ALIGN_NORMAL here should be fine, since this method doesn't depend on
255264
// how exactly lines are aligned, just their width
256265
Layout.Alignment.ALIGN_NORMAL,
@@ -599,6 +608,34 @@ public void setHyphenationFrequency(int hyphenationFrequency) {
599608
mShouldAdjustSpannableFontSize = true;
600609
}
601610

611+
@Override
612+
@RequiresApi(Build.VERSION_CODES.TIRAMISU)
613+
public void setLineBreakStyle(int lineBreakStyle) {
614+
super.setLineBreakStyle(lineBreakStyle);
615+
mShouldAdjustSpannableFontSize = true;
616+
}
617+
618+
@Override
619+
@RequiresApi(Build.VERSION_CODES.TIRAMISU)
620+
public void setLineBreakWordStyle(int lineBreakWordStyle) {
621+
super.setLineBreakWordStyle(lineBreakWordStyle);
622+
mShouldAdjustSpannableFontSize = true;
623+
}
624+
625+
@SuppressLint("InlinedApi")
626+
private int getLineBreakStyleCompat() {
627+
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU
628+
? getLineBreakStyle()
629+
: LineBreakConfig.LINE_BREAK_STYLE_NONE;
630+
}
631+
632+
@SuppressLint("InlinedApi")
633+
private int getLineBreakWordStyleCompat() {
634+
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU
635+
? getLineBreakWordStyle()
636+
: LineBreakConfig.LINE_BREAK_WORD_STYLE_NONE;
637+
}
638+
602639
@Override
603640
public void setLetterSpacing(float letterSpacing) {
604641
if (Float.isNaN(letterSpacing)) {

‎packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.kt‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,20 @@ public constructor(
343343
}
344344
}
345345

346+
@ReactProp(name = "lineBreak")
347+
public fun setLineBreak(view: ReactTextView, lineBreak: String?) {
348+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
349+
view.lineBreakStyle = TextAttributeProps.getLineBreakStyle(lineBreak)
350+
}
351+
}
352+
353+
@ReactProp(name = "wordBreak")
354+
public fun setWordBreak(view: ReactTextView, wordBreak: String?) {
355+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
356+
view.lineBreakWordStyle = TextAttributeProps.getLineBreakWordStyle(wordBreak)
357+
}
358+
}
359+
346360
@ReactPropGroup(
347361
names =
348362
[

‎packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.kt‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
package com.facebook.react.views.text
99

10+
import android.annotation.SuppressLint
11+
import android.graphics.text.LineBreakConfig
1012
import android.os.Build
1113
import android.text.Layout
1214
import android.text.TextUtils.TruncateAt
@@ -612,6 +614,36 @@ public class TextAttributeProps private constructor() {
612614
else -> Layout.HYPHENATION_FREQUENCY_FULL
613615
}
614616

617+
// The LineBreakConfig constants are inlined at compile time, so reading them is safe below API
618+
// 33. Callers apply the result only on API 33+.
619+
// Maps CSS `line-break` values to LineBreakConfig.LINE_BREAK_STYLE_*.
620+
@SuppressLint("InlinedApi")
621+
internal fun getLineBreakStyle(lineBreak: String?): Int =
622+
when (lineBreak) {
623+
null,
624+
"auto" -> LineBreakConfig.LINE_BREAK_STYLE_NONE
625+
"loose" -> LineBreakConfig.LINE_BREAK_STYLE_LOOSE
626+
"normal" -> LineBreakConfig.LINE_BREAK_STYLE_NORMAL
627+
"strict" -> LineBreakConfig.LINE_BREAK_STYLE_STRICT
628+
else -> {
629+
FLog.w(ReactConstants.TAG, "Invalid lineBreak: $lineBreak")
630+
LineBreakConfig.LINE_BREAK_STYLE_NONE
631+
}
632+
}
633+
634+
// Maps CSS `word-break` values to LineBreakConfig.LINE_BREAK_WORD_STYLE_*.
635+
@SuppressLint("InlinedApi")
636+
internal fun getLineBreakWordStyle(wordBreak: String?): Int =
637+
when (wordBreak) {
638+
null,
639+
"normal" -> LineBreakConfig.LINE_BREAK_WORD_STYLE_NONE
640+
"auto-phrase" -> LineBreakConfig.LINE_BREAK_WORD_STYLE_PHRASE
641+
else -> {
642+
FLog.w(ReactConstants.TAG, "Invalid wordBreak: $wordBreak")
643+
LineBreakConfig.LINE_BREAK_WORD_STYLE_NONE
644+
}
645+
}
646+
615647
public fun getEllipsizeMode(ellipsizeMode: String?): TruncateAt? =
616648
when (ellipsizeMode) {
617649
"head" -> TruncateAt.START

‎packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.kt‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import android.content.res.AssetManager
1111
import android.graphics.Color
1212
import android.graphics.RectF
1313
import android.graphics.Typeface
14+
import android.graphics.text.LineBreakConfig
1415
import android.os.Build
1516
import android.text.BoringLayout
1617
import android.text.Layout
@@ -99,6 +100,8 @@ internal object TextLayoutManager {
99100
const val PA_KEY_TEXT_ALIGN_VERTICAL: Int = 8
100101
const val PA_KEY_TEXT_WIDTH_MODE: Int = 9
101102
const val PA_KEY_MINIMUM_FONT_SCALE: Int = 10
103+
const val PA_KEY_LINE_BREAK: Int = 11
104+
const val PA_KEY_WORD_BREAK: Int = 12
102105

103106
private val TAG: String = TextLayoutManager::class.java.simpleName
104107

@@ -850,6 +853,8 @@ internal object TextLayoutManager {
850853
includeFontPadding: Boolean,
851854
textBreakStrategy: Int,
852855
hyphenationFrequency: Int,
856+
lineBreakStyle: Int,
857+
lineBreakWordStyle: Int,
853858
alignment: Layout.Alignment,
854859
justificationMode: Int,
855860
ellipsizeMode: TextUtils.TruncateAt?,
@@ -905,6 +910,8 @@ internal object TextLayoutManager {
905910
includeFontPadding,
906911
textBreakStrategy,
907912
hyphenationFrequency,
913+
lineBreakStyle,
914+
lineBreakWordStyle,
908915
alignment,
909916
justificationMode,
910917
ellipsizeMode,
@@ -921,6 +928,8 @@ internal object TextLayoutManager {
921928
includeFontPadding,
922929
textBreakStrategy,
923930
hyphenationFrequency,
931+
lineBreakStyle,
932+
lineBreakWordStyle,
924933
alignment,
925934
justificationMode,
926935
ellipsizeMode,
@@ -941,6 +950,8 @@ internal object TextLayoutManager {
941950
includeFontPadding,
942951
textBreakStrategy,
943952
hyphenationFrequency,
953+
lineBreakStyle,
954+
lineBreakWordStyle,
944955
alignment,
945956
justificationMode,
946957
ellipsizeMode,
@@ -1000,6 +1011,8 @@ internal object TextLayoutManager {
10001011
includeFontPadding: Boolean,
10011012
textBreakStrategy: Int,
10021013
hyphenationFrequency: Int,
1014+
lineBreakStyle: Int,
1015+
lineBreakWordStyle: Int,
10031016
alignment: Layout.Alignment,
10041017
justificationMode: Int,
10051018
ellipsizeMode: TextUtils.TruncateAt?,
@@ -1028,6 +1041,21 @@ internal object TextLayoutManager {
10281041
builder.setUseLineSpacingFromFallbacks(true)
10291042
}
10301043

1044+
// Leave the platform default in place unless a style was requested, so text without these props
1045+
// lays out exactly as before.
1046+
if (
1047+
Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU &&
1048+
(lineBreakStyle != LineBreakConfig.LINE_BREAK_STYLE_NONE ||
1049+
lineBreakWordStyle != LineBreakConfig.LINE_BREAK_WORD_STYLE_NONE)
1050+
) {
1051+
builder.setLineBreakConfig(
1052+
LineBreakConfig.Builder()
1053+
.setLineBreakStyle(lineBreakStyle)
1054+
.setLineBreakWordStyle(lineBreakWordStyle)
1055+
.build()
1056+
)
1057+
}
1058+
10311059
// Android shifts negative (left-side) start overhang itself. RTL start overhang is on the
10321060
// right, so createLayout reserves that space in a second pass while preserving the EXACT Yoga
10331061
// measurement returned to the caller.
@@ -1208,6 +1236,18 @@ internal object TextLayoutManager {
12081236
TextAttributeProps.getHyphenationFrequency(
12091237
paragraphAttributes.getString(PA_KEY_HYPHENATION_FREQUENCY),
12101238
)
1239+
val lineBreakStyle =
1240+
TextAttributeProps.getLineBreakStyle(
1241+
if (paragraphAttributes.contains(PA_KEY_LINE_BREAK))
1242+
paragraphAttributes.getString(PA_KEY_LINE_BREAK)
1243+
else null,
1244+
)
1245+
val lineBreakWordStyle =
1246+
TextAttributeProps.getLineBreakWordStyle(
1247+
if (paragraphAttributes.contains(PA_KEY_WORD_BREAK))
1248+
paragraphAttributes.getString(PA_KEY_WORD_BREAK)
1249+
else null,
1250+
)
12111251
val adjustFontSizeToFit =
12121252
if (paragraphAttributes.contains(PA_KEY_ADJUST_FONT_SIZE_TO_FIT))
12131253
paragraphAttributes.getBoolean(PA_KEY_ADJUST_FONT_SIZE_TO_FIT)
@@ -1250,6 +1290,8 @@ internal object TextLayoutManager {
12501290
includeFontPadding,
12511291
textBreakStrategy,
12521292
hyphenationFrequency,
1293+
lineBreakStyle,
1294+
lineBreakWordStyle,
12531295
alignment,
12541296
justificationMode,
12551297
paint,
@@ -1265,6 +1307,8 @@ internal object TextLayoutManager {
12651307
includeFontPadding,
12661308
textBreakStrategy,
12671309
hyphenationFrequency,
1310+
lineBreakStyle,
1311+
lineBreakWordStyle,
12681312
alignment,
12691313
justificationMode,
12701314
ellipsizeMode,
@@ -1288,6 +1332,8 @@ internal object TextLayoutManager {
12881332
includeFontPadding,
12891333
textBreakStrategy,
12901334
hyphenationFrequency,
1335+
lineBreakStyle,
1336+
lineBreakWordStyle,
12911337
alignment,
12921338
justificationMode,
12931339
ellipsizeMode,
@@ -1413,6 +1459,8 @@ internal object TextLayoutManager {
14131459
includeFontPadding: Boolean,
14141460
textBreakStrategy: Int,
14151461
hyphenationFrequency: Int,
1462+
lineBreakStyle: Int,
1463+
lineBreakWordStyle: Int,
14161464
alignment: Layout.Alignment,
14171465
justificationMode: Int,
14181466
paint: TextPaint,
@@ -1477,6 +1525,8 @@ internal object TextLayoutManager {
14771525
includeFontPadding,
14781526
textBreakStrategy,
14791527
hyphenationFrequency,
1528+
lineBreakStyle,
1529+
lineBreakWordStyle,
14801530
alignment,
14811531
justificationMode,
14821532
null,

‎packages/react-native/ReactAndroid/src/test/java/com/facebook/react/views/text/PreparedLayoutTextViewAccessibilityTextTest.kt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
package com.facebook.react.views.text
99

1010
import android.annotation.SuppressLint
11+
import android.graphics.text.LineBreakConfig
1112
import android.text.Layout
1213
import android.text.SpannableString
1314
import android.text.TextPaint
@@ -80,6 +81,8 @@ class PreparedLayoutTextViewAccessibilityTextTest {
8081
/* includeFontPadding = */ false,
8182
/* textBreakStrategy = */ Layout.BREAK_STRATEGY_HIGH_QUALITY,
8283
/* hyphenationFrequency = */ Layout.HYPHENATION_FREQUENCY_NONE,
84+
/* lineBreakStyle = */ LineBreakConfig.LINE_BREAK_STYLE_NONE,
85+
/* lineBreakWordStyle = */ LineBreakConfig.LINE_BREAK_WORD_STYLE_NONE,
8386
Layout.Alignment.ALIGN_NORMAL,
8487
/* justificationMode = */ 0,
8588
/* ellipsizeMode = */ TextUtils.TruncateAt.END,

‎packages/react-native/ReactAndroid/src/test/java/com/facebook/react/views/text/TextLayoutManagerAbsoluteLayoutWithFractionalPixelTest.kt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
package com.facebook.react.views.text
99

1010
import android.annotation.SuppressLint
11+
import android.graphics.text.LineBreakConfig
1112
import android.text.BoringLayout
1213
import android.text.Layout
1314
import android.text.SpannableString
@@ -97,6 +98,8 @@ class TextLayoutManagerAbsoluteLayoutWithFractionalPixelTest {
9798
/* includeFontPadding = */ false,
9899
/* textBreakStrategy = */ Layout.BREAK_STRATEGY_HIGH_QUALITY,
99100
/* hyphenationFrequency = */ Layout.HYPHENATION_FREQUENCY_NONE,
101+
/* lineBreakStyle = */ LineBreakConfig.LINE_BREAK_STYLE_NONE,
102+
/* lineBreakWordStyle = */ LineBreakConfig.LINE_BREAK_WORD_STYLE_NONE,
100103
Layout.Alignment.ALIGN_NORMAL,
101104
/* justificationMode = */ 0,
102105
/* ellipsizeMode = */ null,

0 commit comments

Comments
 (0)