Commit Graph

68 Commits

Author SHA1 Message Date
ismarbesic 07da2ff3e1 feat(ios): support condensed system font on fabric (#52259)
Summary:
This PR adds support for using the condensed system font on iOS when passing "SystemCondensed" as fontFamily. This behavior existed in the old architecture but was never ported to the new one, see [RCTFont.mm](https://github.com/facebook/react-native/blob/main/packages/react-native/React/Views/RCTFont.mm#L434) as reference. Fixes https://github.com/facebook/react-native/issues/52258.

## Changelog:

[IOS] [ADDED] - Add support for condensed system font when using the new react native architecture.

Pull Request resolved: https://github.com/facebook/react-native/pull/52259

Test Plan:
Before:
<img width="275" src="https://github.com/user-attachments/assets/8744a5ae-252c-46db-b5f9-b803f3e1c671" />

After:
<img width="275" src="https://github.com/user-attachments/assets/69ec27a3-5c9a-46e3-a80a-0e02b76d8813" />

Reviewed By: cortinico

Differential Revision: D82208140

Pulled By: javache

fbshipit-source-id: b23a97c94bf45144c3f0860c30e35cae88c7dc2f
2025-09-15 11:31:30 -07:00
Marco Wang da9136f587 Turn on null strict comparison check for xplat js (#53379)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53379

X-link: https://github.com/facebook/react/pull/34240

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D80648362

fbshipit-source-id: cc47ae207f29a3ddb68bc0e029b8773f89503c52
2025-08-21 16:46:23 -07:00
Sam Zhou 6b354155ed Replace $FlowFixMe(Props|State|Empty) with just $FlowFixMe (#53002)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53002

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D79524515

fbshipit-source-id: 18b96538a62c7ae5912b1e89d2b50c1420c7eaf5
2025-08-04 11:43:00 -07:00
Nick Lefever 5e80759994 Add disabled paragraph prop (#52846)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52846

Adding the Paragraph `disabled` property for RN Android.

This diff also adds a new Text example to RNTester for disabled text.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D78990840

fbshipit-source-id: dd25b890597bc9f728f929b38c2f680631b7f476
2025-07-27 17:20:44 -07:00
Nick Gerleman 7cd0b42ca0 Add text examples combining textAlign, attachments, script direction, and layout direction (#52445)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52445

This shows some broken stuff (TM), but also asserts current behaviors

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D77702743

fbshipit-source-id: a20d5b09e84d86a16e2443726ac82416b13796a8
2025-07-14 19:43:12 -07:00
Nick Gerleman dd9d7c0e74 Add Tests for layout events of ellipsized Text (#51666)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51666

The platforms handle this in pretty different ways right now. Let's add a test showing the differences.

Android also adds a bunch of unicode zero width spaces in there...

Changelog: [Internal]

Reviewed By: mlord93

Differential Revision: D75567210

fbshipit-source-id: 98cac7d3fd23451868b55b69478e2667a2de3716
2025-05-28 19:20:55 -07:00
Nick Gerleman 6e8ce60bd4 Implement ReactCompoundView for PreparedLayoutTextView (#51551)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51551

This allows hit RN's hit testing to find nested spans, and click them.

This mechanism is fully separate from the one used by a11y virtual views, and ClickableSpan, such as those added for links via dataDetectorType (and also the `link` role).

When we do have a link accessibilityRole, that ClickableSpan hit test seems to prevent the React one, and we only activate the onPress once (but then add keyboard interaction, press visual, and add to the a11y tree).

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D75257326

fbshipit-source-id: 0c693f581ec121cf4b4e3e2040d141985118224f
2025-05-27 17:23:36 -07:00
Dawid Małecki b34e56259a Remove TextAncestor import from rn-tester TextExample (#51603)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51603

In `rn-tester` TextAncestor was used to create a inlineView wrapper:

```js
function InlineView(props) {
  return (
    <TextAncestor.Provider value={false}>
      <View {...props} />
    </TextAncestor.Provider>
  );
}
```

however, it is already done in View.js and TextAncestor shouldn't be used outside of react-native package:

```js
 if (hasTextAncestor) {
    return <TextAncestor value={false}>{actualView}</TextAncestor>;
  }
  return actualView;
```

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D75408231

fbshipit-source-id: 7f12278296dcfe56246f6b7065f5a094e4099f7a
2025-05-27 01:21:17 -07:00
Tim Yung 1977dd6596 RN: Sort Pragmas in Headers (#51554)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51554

Sorts pragma directives file headers in React Native.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75264593

fbshipit-source-id: 9e4b253dd0fc94dc2fc469d7114b93a8aae305f4
2025-05-22 21:18:53 -07:00
Nick Gerleman b70c73d8f7 Fix missing height constraints when creating Fabric layout for adjustsFontSizeToFit (#51550)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51550

`adjustsFontSizeToFit` will adjust font size so that given text fits in both veritcal and horizontal bounds. The algorithm to mutate text to fit is executed during TextLayoutManager during layout creation for Fabric, and then re-executed in `TextView.onDraw()`. See D56134348 which introduced the logic.

In Facsimile, we were not seeing font size adjusted when text is too tall. This is because we are only incorporating the height constraint during Spannable mutation during draw, but not the original layout, which Facsimile uses directly.

This could potentially fix other bugs, where width may not corredpond to the final font size we settle on during drawing.

Changelog:
[Android][Fixed] - Fix missing height constraints when creating Fabric layout for `adjustsFontSizeToFit`

Reviewed By: mdvacca

Differential Revision: D75251391

fbshipit-source-id: 77d90c49d48911e63131f9f088cfce13946c67d6
2025-05-22 17:42:29 -07:00
Panos Vekris 0c70c0166e pre-suppress errors for natural inference rollout in xplat/js (#51524)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51524

Links in error suppressions will point to the announcement post in Flow FYI.

Changelog: [Internal]

drop-conflicts

Reviewed By: marcoww6

Differential Revision: D75188177

fbshipit-source-id: 27ea1fbee848e9371e679cf423e30bc9608edea0
2025-05-22 02:50:47 -07:00
Panos Vekris 50ca7e5730 manual annotations in preparation of natural inference rollout in react-native, tools, etc.
Summary:
The Flow team is improving the way Flow infers type for primitive literals. This diff prepares the codebase for the new behavior by adding type annotations, or annotations of the form `'abc' as const`.

Changelog: [internal]

Reviewed By: marcoww6

Differential Revision: D75188179

fbshipit-source-id: be50990f23f79cf2d8dae7576af5190218adcafe
2025-05-21 20:06:46 -07:00
Panos Vekris 1eebb5aa11 Back out "add 'as const' annotations in preparation of natural inference rollout in xplat/js [4/n]"
Summary:
Original commit changeset: 67ee5673816d

Original Phabricator Diff: D75114154

Reviewed By: SamChou19815

Differential Revision: D75161840

fbshipit-source-id: 144fc0e488154b957f4f2a549c077a2784124849
2025-05-21 12:03:51 -07:00
Panos Vekris 2a068c6559 add 'as const' annotations in preparation of natural inference rollout in xplat/js [4/n] (#51488)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51488

The Flow team is improving the way Flow infers type for primitive literals.
Announcement: https://fb.workplace.com/groups/flowlang/permalink/1725180268087629/

This diff prepares the codebase for the new behavior by codemoding `as const` annotations.

## Repro steps

1/ Used steps in D73610163 to produce the code changes.

2/ Reverted files where `flow` errored:
```
flow status --show-all-errors > errors.log
node ~/fbsource/fbcode/flow/facebook/error-analyzer.js errors.log |
  awk -F':' '{ print $1 }' | sort -u | grep -v 'Total Error Count' |
  xargs hg revert --rev .
```

3/ Reverted files that did not improve error count in new Flow mode
```
# Run Flow before change
~/fbsource/fbcode/flow/facebook/flowd status --show-all-errors > errors-0.log
# Run Flow after change
~/fbsource/fbcode/flow/facebook/flowd status --show-all-errors > errors-1.log

# Compute error counts before and after
node ~/fbsource/fbcode/flow/facebook/error-analyzer.js errors-0.log | sort > errors-counts-0.log
node ~/fbsource/fbcode/flow/facebook/error-analyzer.js errors-1.log | sort > errors-counts-1.log

# Revert files with no change in error count
comm -12 errors-counts-0.log errors-counts-1.log | awk -F':' '{ print $1 }' | xargs hg revert --rev .~1
```

## Note to code owners

Due to the large number of errors involved in this rollout, adding `as const` was the most feasible large-scale automated solution. Ideally, a lot of these errors would be fixed by adding other appropriate type annotations. For example instead of annotating
```
type Shape = {type: 'circle', radius: number} | {type: 'square', side: number} | ...;
type ShapeKind = 'circle' | 'square' | 'triangle';
const circle = {
  type: "circle" as const,  // <-- annotation added here
  radius: 42,
};
shape.type as ShapeKind;
takesShape(circle);
```
a more appropriate annotation would be
```
const circle: Circle = { type: "circle"; radius: 42 };
...
```

Changelog: [Internal]

drop-conflicts

Reviewed By: SamChou19815

Differential Revision: D75114154

fbshipit-source-id: 67ee5673816da9625431e2a2466a1e0038386151
2025-05-21 08:42:30 -07:00
Nick Gerleman 0cd6a29981 TextSharedExamples and empty text E2E test (#51464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51464

Add a module of shared examples, like `TextInputSharedExamples`, to avoid copy/paste between these.

Modifies the empty test example a bit and adds an E2E test.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D74780847

fbshipit-source-id: 30c2830ef0b638680fe75b4bcf9f138f5c01e190
2025-05-19 18:15:39 -07:00
Nick Gerleman 99f962627f Fix New Arch handling of inline views when text truncated (#49960)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49960

Fixes  https://github.com/facebook/react-native/issues/49106

RN legacy arch, and web, will clip inline content which appears after elipsized text. This is the correct behavior, compared to new arch, which will put it in a random place depending on the platform.

`line-clamp`: https://jsfiddle.net/7xgdke1b/
`text-overflow`: https://jsfiddle.net/7xgdke1b/2/

Fabric renderer does not, funnily enough, having an `isClipped` field on `TextMeasurement::Attachment` that is never used.

This change propagates state for whether an attachment is beyond elipsized area to this measurement, then when we see it, we set empty layout results with `DisplayType::None` so that we don't create native views. We don't layout child views either, but this seems to work out okay, even when removing and re-adding `numberOfLines`.

Changelog:
[General][Fixed] - Fix New Arch handling of inline views when text truncated

Reviewed By: mdvacca

Differential Revision: D70922174

fbshipit-source-id: 8c1f4aadbf53ff64ce55b44d6c7953d9b2e40bc5
2025-03-11 18:03:56 -07:00
Rickard Zrinski 97cf42f979 Fix maxFontSizeMultiplier prop on Text and TextInput components in new architecture (#47614)
Summary:
The `maxFontSizeMultiplier` prop for `Text` and `TextInput` was not handled in Fabric / New Architecture as documented in https://github.com/facebook/react-native/issues/47499.

bypass-github-export-checks

## Changelog:

[GENERAL] [FIXED] - Fix `maxFontSizeMultiplier` prop on `Text` and `TextInput` components in Fabric / New Architecture

Pull Request resolved: https://github.com/facebook/react-native/pull/47614

Test Plan:
I have not added any automated tests for this change but try to do so if requested. I have however added examples to RN Tester for both the Text and TextInput components, as well as compared the behaviour with Paper / Old Architecture. Both on version 0.76.

Noticed now I didn't do exactly the same steps in both videos, oops! Be aware that reapplying changes made in the Settings are currently half-broken on the new architecture, thus I'm restarting the app on Android and iOS. But this issue is unrelated to my changes. I've tested on main branch and it has the same issue.

Here are comparison videos between Paper and Fabric on iOS *after* I've made my fix.

### Text
| Paper  | Fabric |
| ------------- | ------------- |
| <video src="https://github.com/user-attachments/assets/f4fd009f-aa6d-41ab-92fa-8dcf1e351ba1" /> | <video src="https://github.com/user-attachments/assets/fda42cc6-34c2-42a7-a6e2-028e7c866075" /> |

### TextInput
| Paper  | Fabric |
| ------------- | ------------- |
| <video src="https://github.com/user-attachments/assets/59b59f7b-25d2-4b5b-a8e2-d2054cc6390b" /> | <video src="https://github.com/user-attachments/assets/72068566-8f2a-4463-874c-45a6f5b63b0d" /> |

Reviewed By: Abbondanzo

Differential Revision: D65953019

Pulled By: cipolleschi

fbshipit-source-id: 90c3c7e236229e9ad9bd346941fafe4af8a9d9fc
2025-01-29 09:27:44 -08:00
Iwo Plaza 1be7e1a95f Migrate Libraries/Text, Libraries/Share and Libraries/Settings to use export syntax (#48901)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48901

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.

## This diff
- Updates files in `Libraries/Text`, `Libraries/Share` and `Libraries/Settings` to use `export` syntax.
- Appends `.default` to requires of the changed files.
- Updates test files.
- Updates the public API snapshot *(intented breaking change)*

Changelog:
[General][Breaking] - Files inside `Libraries/Text`, `Libraries/Share` and `Libraries/Settings` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.

Reviewed By: huntie

Differential Revision: D68562844

fbshipit-source-id: bd71a341e33d3629121aa61549139c4b1cd62c3f
2025-01-24 08:49:15 -08:00
Dawid Małecki f36bfe5dfa Remove redundant {||} syntax (#48686)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48686

Changelog:
[Internal] - Removed redundant `{||}` syntax

Reviewed By: javache

Differential Revision: D68205038

fbshipit-source-id: f7d3271142b6443a5859c3b668b7aebd3ce3ef3f
2025-01-15 07:07:01 -08:00
Mateo Guzmán 33aebc34bf Fix RNTester dark mode Android Text examples (#48380)
Summary:
The Android `Text` examples in dark mode are not readable. This PR addresses that by replacing the `Text` usages with `RNTesterText`.

## Changelog:

[INTERNAL] [FIXED] - Fixing dark mode Android `Text` examples

Pull Request resolved: https://github.com/facebook/react-native/pull/48380

Test Plan:
Some screenshots after the fixes.

| Image 1 | Image 2 | Image 3 | Image 4 | Image 5 |
|---------|---------|---------|---------|---------|
| ![Screenshot_1734981250](https://github.com/user-attachments/assets/d9c27ac7-5024-478b-a47c-3c057801eea1) | ![Screenshot_1734981168](https://github.com/user-attachments/assets/92c6e11a-ac30-46f5-8878-3659d9e40f9a) | ![Screenshot_1734981146](https://github.com/user-attachments/assets/8bfba649-e036-473a-a622-2289daf67951) | ![Screenshot_1734981127](https://github.com/user-attachments/assets/9b1e2a68-8b34-463b-8637-f2b5682733d2) | ![Screenshot_1734981115](https://github.com/user-attachments/assets/af0c85c5-6216-4af1-ae92-b818213f3719) |
| Image 6 | Image 7 | Image 8 | Image 9 | Image 10 |
|---------|---------|---------|---------|---------|
| ![Screenshot_1734981101](https://github.com/user-attachments/assets/91a07f43-8b9e-4462-8906-5ee1f68741a5) | ![Screenshot_1734981080](https://github.com/user-attachments/assets/3b8ffe9a-53b9-4863-b332-d3055740aa18) | ![Screenshot_1734980904](https://github.com/user-attachments/assets/c5aa8bb6-f1f6-4693-bc31-74557946f009) | ![Screenshot_1734981057](https://github.com/user-attachments/assets/10c8c785-58b8-401a-ad18-7bdcd91cd28d) | ![Screenshot_1734980876](https://github.com/user-attachments/assets/d9ed3b35-01fe-4311-adf3-7a6e4e13aeab) |

Reviewed By: javache

Differential Revision: D67657571

Pulled By: philIip

fbshipit-source-id: da93d072f4bb32017961ee70c76f6add8a874ae1
2025-01-03 15:44:16 -08:00
CHEN Xian-an 1763321c89 Support system font families on iOS (#47544)
Summary:
Apple introduced system font families

```
font-family: system-ui;
font-family: ui-sans-serif;
font-family: ui-serif;
font-family: ui-monospace;
font-family: ui-rounded;
```

for Safari at 2020 (see https://developer.apple.com/videos/play/wwdc2020/10663/?time=872).

This PR implementation supports above font families on iOS.

bypass-github-export-checks

## Changelog:

[IOS] [ADDED] - Support system font families (system-ui, ui-sans-serif, ui-serif, ui-monospace, and ui-rounded) on iOS

Pull Request resolved: https://github.com/facebook/react-native/pull/47544

Test Plan: Run `RNTester` and view the `Text` component where shows the usage for those font families.

Reviewed By: NickGerleman

Differential Revision: D65761307

Pulled By: cipolleschi

fbshipit-source-id: 18628160b7753b314389e887cddfe9d0ec96ee1d
2024-12-12 10:50:34 -08:00
Mateo Guzmán 79ed11f8f4 fix(rn-tester): text input and xml http request dark mode adjustments (#48207)
Summary:
Was troubleshooting in these modules recently and noticed a few texts off in dark mode. Replacing a few instances of the Text component in all I could see in the two screens.

## Changelog:

[INTERNAL] - RN Tester `TextInput` & `XMLHttpRequest` dark mode adjustments

Pull Request resolved: https://github.com/facebook/react-native/pull/48207

Test Plan:
<details>
<summary>View Screenshots (before fixes)</summary>

| Screenshot 1 | Screenshot 2 | Screenshot 3 | Screenshot 4 | Screenshot 5 | Screenshot 6 |
|--------------|--------------|--------------|--------------|--------------|--------------|
| ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 11 36](https://github.com/user-attachments/assets/c396bc5d-4b3c-4f63-8ac0-68bc808aa9d4) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 11 21](https://github.com/user-attachments/assets/cd8e5a2f-9066-4bc7-b56b-65dbd6df7dc4) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 10 30](https://github.com/user-attachments/assets/da451c18-40cd-4421-b8f5-a2462f82fee9) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 10 23](https://github.com/user-attachments/assets/32925fdb-f983-439f-b898-6986b739895a) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 10 19](https://github.com/user-attachments/assets/f0db7b49-dfef-4abc-aef0-2d55b016c0f8) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 10 16](https://github.com/user-attachments/assets/bad6dc45-3679-4bb6-aadd-6743053cd90f) |
| ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 10 10](https://github.com/user-attachments/assets/43028f51-c6e2-4b26-b20d-a3639606d6d5) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 10 07](https://github.com/user-attachments/assets/f8e2196e-bc64-4507-b330-d1d85730ddff) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 09 59](https://github.com/user-attachments/assets/a7100770-4b38-421f-9b73-09e4fff9e012) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 09 53](https://github.com/user-attachments/assets/27759c8c-0e56-4b92-8173-ba031b994e5c) | | | |

</details>

<details>
<summary>View Screenshots (after fixes)</summary>

| Screenshot 1 | Screenshot 2 | Screenshot 3 | Screenshot 4 | Screenshot 5 | Screenshot 6 |
|--------------|--------------|--------------|--------------|--------------|--------------|
| ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 30](https://github.com/user-attachments/assets/71c0287d-d98a-4bfe-85dc-1e08da12ce43) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 26](https://github.com/user-attachments/assets/45eac165-f42a-4193-98cc-3ee85d963382) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 23](https://github.com/user-attachments/assets/c0e4432d-2d1d-487f-8965-3829c3257364) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 19](https://github.com/user-attachments/assets/ab81500c-66c1-4b90-b2b1-f7c490e0029b) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 16](https://github.com/user-attachments/assets/aafcad74-e851-49a8-9db0-df06f81f0b30) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 11](https://github.com/user-attachments/assets/29a2a6c8-e448-4c90-844d-29a248f9ab69) |
| ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 05 07](https://github.com/user-attachments/assets/54e505c4-c554-4000-aac1-61b97e034f55) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 04 39](https://github.com/user-attachments/assets/0e91dc29-199d-424e-b36a-6b0f7a317cd2) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 04 22](https://github.com/user-attachments/assets/e965b01d-0b03-4d01-a971-57c3bd550146) | ![Simulator Screenshot - iPhone SE (3rd generation) - 2024-12-11 at 00 04 15](https://github.com/user-attachments/assets/50ef03a6-bf1a-4db3-845b-e98373369574) |  |  |

</details>

Reviewed By: cipolleschi

Differential Revision: D67087492

Pulled By: javache

fbshipit-source-id: c9c64377d8c10d965bc5db7783aa80f099ce858a
2024-12-12 04:07:10 -08:00
Nick Gerleman 7cb9fa9737 Add lineHeight screenshot tests (#47270)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47270

Lets add some screenshot tests, along with one more example, and fixing some silly typos in test IDs.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D65094482

fbshipit-source-id: a5f3e06c4737158bf6419364d05668c3feb1bd5e
2024-10-29 17:53:16 -07:00
Dawid 08e8f6adfd fix(Android) drawing additional empty line when 'textAlign' is set to 'justify' (#47122)
Summary:
Fixes https://github.com/facebook/react-native/issues/46908

The `justificationMode` is not set for multiline text without unicode characters with known width on both architectures. This caused the issue of drawing additional empty line at the end of `TextView` because Yoga thought that text takes 5 lines and falsely calculated it's height.

Currently, on the old architecture, the `justificationMode` is set only on text that is not boring (contains unicode characters) with unknown width. I am not sure why is that, so I am opening this as a draft for now as I am still checking if it doesn't break anything.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ANDROID] [FIXED] - fix generating empty line at the end of multiline text view when `textAlign` is set to `justify`

Pull Request resolved: https://github.com/facebook/react-native/pull/47122

Test Plan: I've tested on both architectures on repro provided in the issue.

Reviewed By: javache

Differential Revision: D65002386

Pulled By: NickGerleman

fbshipit-source-id: 0187956c88e6eb1e637c24e82b3052cc82581a64
2024-10-29 14:22:59 -07:00
Nick Gerleman 7715a95895 Add more lineHeight examples (#47162)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47162

Add some more interesting cases in prepration for screenshot testing

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D64775710

fbshipit-source-id: 70b390ad944841044e0d5004bddd1a8d3cfc6cbf
2024-10-22 15:49:49 -07:00
muskan27797 fa62b7e1ed Add test for background color and border width in text.yml (#46829)
Summary:
Part of this: https://github.com/facebook/react-native/issues/46757
Solves:

- ME2E0017
- ME2E0018

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ Internal ] [ Added ] - Add e2e test for button

Pull Request resolved: https://github.com/facebook/react-native/pull/46829

Test Plan:
yarn e2e-test-ios
yarn e2e-test-android

Reviewed By: rshest

Differential Revision: D63889079

Pulled By: cipolleschi

fbshipit-source-id: ca2ede3142d77170fcb4121b025eab56818ffb07
2024-10-04 07:05:40 -07:00
Jorge Cabiedes Acosta 2241c3146f Remove experimental_ prefix from boxShadow (#46404)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46404

As title

Second attempt to rename the prop. BoxShadow caused no issues after renaming but it was batched with `filter` which we reverted.

Changelog: [General] [Changed] - Add official `boxShadow` CSSProperty.

Reviewed By: NickGerleman, cyan33

Differential Revision: D62400814

fbshipit-source-id: ad721f6d11d614e987048e55556b05ff74a4747d
2024-09-11 16:01:06 -07:00
Nick Gerleman a2d53d5ea0 Support simple opacity in nested text (#46267)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46267

We can propagate opacity, already part of AttributedString, to alpha channel of paint used to draw text and background on canvas.

This does not support propagating to views, and contrary to the iOS example added which originated with legacy arch, does not correctly support nesting opacity. This is a limitation of new arch more generally, where an AttributedString fragment only contains inner-most opacity.

Bg and foreground are drawn separately with alpha as well, instead of rendering overlapping content offscreen to properly apply it (this is an issue on RN Android more generally, and existing color alpha support, but is pretty noticeable here).

This impl targets new arch only.

Changelog:
[Android][Added] - Support simple opacity in nested text

Reviewed By: alanleedev

Differential Revision: D61999163

fbshipit-source-id: adb99834e94e00cb84a98d56f422c15b1bd849db
2024-08-29 20:43:30 -07:00
Jorge Cabiedes Acosta acbde249b7 Revert D61726506 (#46266)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46266

This diff reverts D61726506
T200279372

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61986793

fbshipit-source-id: bbf462b79192b67801a6cf56727f8f43ade8fd56
2024-08-29 20:34:19 -07:00
Jorge Cabiedes Acosta 6fa54f9b5d Remove experimental_ prefix from boxShadow and filter (#46245)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46245

As title

Changelog: [General] [Changed] - Add official `boxShadow` and `filter` CSS properties

Reviewed By: cipolleschi

Differential Revision: D61726506

fbshipit-source-id: 8ee7a95d95a66f1f890a5ebb6791da73219b2c52
2024-08-28 23:03:41 -07:00
Riccardo Cipolleschi 31cbc77f52 Add internal end to end tests for text and background color with border width (#46068)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46068

This change adds some internal E2E tests to verify that the text is rendered properly on top of a solid background color when borderWidth is set

## Changelog
[Internal] - Add E2E tests

Reviewed By: cortinico

Differential Revision: D61392253

fbshipit-source-id: 76e11821eba96ac75b055c5fe94365197c0f9be2
2024-08-20 04:38:45 -07:00
Riccardo Cipolleschi 0f4a405f28 Add Text example with BG and borderWidth
Summary:
This diff adds an example in RNTester to verify that we can draw text on top of a colored background and non uniform border radius.

As you can see from the test plan, the current code works well when:
* There is only the background color
* There is a background color and uniform cornerRadius
* There are non uniform border radius but the background is transparent.

The current code **does not** work when:
* there is a background and non-uniform border radius
* there is a background, uniform border radius and borderwidth

The reason why this happens is because:
* `RCTParagraphComponentView` draws the text in the View's main layer in the `drawRect` method
* `RCTViewComponentView` has a method `invalidateLayer` that, when there are non-uniform border radii o there is a borderWidth, it creates an extra `CALayer` with an image as content and that layer is put on top of the base layer, covering the text.

## Changelog
[Internal] - Add example to RNTester

Reviewed By: cortinico

Differential Revision: D61389317

fbshipit-source-id: 3e0a9e6c611190f90198a1b0b5855431b9f6ed12
2024-08-20 04:38:45 -07:00
Sam Zhou 5b96e90f77 Replace React.Element<any> and unnecessarily specific React.Element with React.MixedElement (#45923)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45923

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D60872182

fbshipit-source-id: b81fb43968c52cbfdb4a9fa57f1175aabc2a3939
2024-08-06 21:33:08 -07:00
Nick Gerleman f26027e3c0 BackgroundStyleApplicator and boxShadow in Text (#45830)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45830

Like the previous diffs, but for Text!

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D60488060

fbshipit-source-id: 9ce89f65f44df75a83f86f14d2cbdfbf96f32a7c
2024-07-31 23:49:48 -07:00
Jakub Piasecki 2932c0f71f Implement baseline alignment function on the new architecture (#45102)
Summary:
On the new architecture, the setup that would allow Yoga to read the baseline of a node was missing. This PR adds it:
- adds new ShadowNode trait - `BaselineYogaNode` that marks a node as having a custom baseline function
- adds `yogaNodeBaselineCallbackConnector` that's responsible for allowing Yoga to call baseline function on the node
- changes signatures of `lastBaseline` and `firstBaseline` to accept `LayoutContext` as the first argument, which is necessary to build an attributed string
- adds implementation of `lastBaseline` that's invoked by `yogaNodeBaselineCallbackConnector`
- adds methods for calculating the last baseline in platform-specific `TextLayoutManagers`, using the same approach on both Android and iOS (this differs from the old architecture where calculations were different)

## Changelog:

[GENERAL] [FIXED] - Fixed `alignItems: 'baseline'` not working correctly on the new architecture

Pull Request resolved: https://github.com/facebook/react-native/pull/45102

Test Plan:
Tested on the relevant part of RNTester:

### Android

|Old arch|New arch before|New arch after|
|-|-|-|
|<img width="426" alt="baseline-android-old-arch" src="https://github.com/facebook/react-native/assets/21055725/08550dfc-cf30-4938-8872-9bef916dc53c">|<img width="426" alt="baseline-android-new-arch-before" src="https://github.com/facebook/react-native/assets/21055725/9e3667f7-5c42-4e23-8972-fd2e994694a4">|<img width="409" alt="Screenshot 2024-07-02 at 16 40 38" src="https://github.com/facebook/react-native/assets/21055725/13379b11-b69e-4082-81cc-dec5e6d092f2">|

### iOS

|Old arch|New arch before|New arch after|
|-|-|-|
|<img width="519" alt="baseline-ios-old-arch" src="https://github.com/facebook/react-native/assets/21055725/da3956a1-5588-4933-87ce-4b5a9c256957">|<img width="519" alt="baseline-ios-new-arch-before" src="https://github.com/facebook/react-native/assets/21055725/09aef2c1-2eec-4710-b237-0f4a0c3d52d0">|<img width="519" alt="Screenshot 2024-07-02 at 16 40 29" src="https://github.com/facebook/react-native/assets/21055725/0a8a7251-1f6f-40db-81d7-4f37142932db">|

Reviewed By: NickGerleman

Differential Revision: D59323974

Pulled By: cortinico

fbshipit-source-id: e50882d399a0791a39ce8b416ed96d8fd3c48f23
2024-07-10 12:43:42 -07:00
Nick Gerleman c046198cc9 Add more clipping examples (#44735)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44735

Add some more examples of overflow clipping for scrollview, text, textinput.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D57999676

fbshipit-source-id: dfede321b2c7c61dda3afaf2aea784f6c295c384
2024-05-31 12:06:33 -07:00
Fabrizio Cucci 95de14dc53 Drop unused code + minor lint fixes (#44645)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44645

Changelog: [Internal]

As per title.

Reviewed By: NickGerleman

Differential Revision: D57664819

fbshipit-source-id: 2388bd01c00d814a12de7f2e285b78f207e6012c
2024-05-22 12:11:33 -07:00
Gijs Weterings 252519666f Deduplicate test case for TextExample in preparation of rntester android onboarding
Summary:
D57197676 reordered the TextExample test cases, but accidentally reused the same string as the case in packages/rn-tester/js/examples/Text/TextInlineViewsExample.js

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D57279961

fbshipit-source-id: 60a41eaf13d82538ee149fe4ef5531e42c00b012
2024-05-20 07:57:10 -07:00
Ruslan Shestopalyuk f8c1ad6f43 Flatten Text examples in RNTester to make them searchable (#44518)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44518

# Changelog:
[Internal] -

For some inexplicable reason, we had majority of `Text` test examples (42 out of 46) in RNTester stuffed into `<RNTesterBlock/>` components inside one huge "Basic" test case.

This was highly imbalanced, introduced extra nesting, cluttering the UI, but most importantly, none of those 42 out 46 test cases were searchable for.

This change flattens all of the corresponding nested test cases to the top level, making them into valid separate test cases, which are also searchable.

It also corresponds to the general structure we have in other test examples, such as `TextInput`.

Reviewed By: cipolleschi

Differential Revision: D57197676

fbshipit-source-id: 777eb2aa238a91bb3f52d2f0ab10edc6bfad5c85
2024-05-10 08:38:59 -07:00
Ruslan Shestopalyuk f4996e0b63 Make text wrap examples not rely on the RNTester window width (#44505)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44505

# Changelog:
[Internal] -

The RNTester/Text tests, that are related to text wrapping (such as "wrap mode", "hyphenation", "ellipsize", "numberOfLines" ones) were written with the mobile form factor in mind, whereas the RNTester window is generally expected to be narrow and tall.

Now, that we are running on other platforms as well, there is no guarantee about the RNTester window width, in general, so these tests relying on particular window width is not practical anymore.

This makes the corresponding tests work in a useful way without making assumptions about the RNTester's window width.

Differential Revision: D57166025

fbshipit-source-id: 3305a31f7ca254d82c85d67c975c1140050adc28
2024-05-09 13:04:43 -07:00
Jakub Piasecki 1f08799560 Fix textAlign with inline views on the new architecture on Android (#44146)
Summary:
On the new architecture on Android on the new arch, `textAlign` style was ignored (`Layout.Alignment.ALIGN_NORMAL` was always used) during the measurement of text. During this phase, the positions of attachments are also calculated, which results in inline views being always positioned as if alignment to the left was set. This PR updates the measurement logic to also take `textAlign` into account during measurement.

Fixes https://github.com/facebook/react-native/issues/41008

## Changelog:

[ANDROID] [FIXED] - Fixed `textAlign` not being taken into account when positioning views inlined in text

Pull Request resolved: https://github.com/facebook/react-native/pull/44146

Test Plan:
<details>
<summary>I've been testing on the following code</summary>

```jsx
import { SafeAreaView, Text, View } from "react-native";

function InlineView(props) {
  return (<View style={{margin: 10}} >
    <Text style={{ textAlign: props.textAlign, backgroundColor: 'cyan' }}>
        Parent Text
        <Text style={{ fontWeight: 'bold' }}>Child Text</Text>
        <View style={{width: 50, height: 50, backgroundColor: 'red'}} />
        <Text style={{ fontWeight: 'bold' }}>Child Text</Text>
        {props.long && <Text style={{ fontWeight: 'bold' }}>aaaa a aaaa aaaaaa aaa a a a aaaaa sdsds dsdSAD asd ASDasd ASDas</Text>}
      </Text>
  </View>)
}

export default function Test() {
  return (
    <SafeAreaView style={{ flex: 1 }}>
      <Text style={{textAlign: 'center', fontSize: 20}}>BoringLayout</Text>
      <InlineView textAlign="left" />
      <InlineView textAlign="center" />
      <InlineView textAlign="right" />
      <InlineView textAlign="justify" />

      <Text style={{textAlign: 'center', fontSize: 20}}>StaticLayout</Text>
      <InlineView textAlign="left" long />
      <InlineView textAlign="center" long />
      <InlineView textAlign="right" long />
      <InlineView textAlign="justify" long/>
    </SafeAreaView>
  );
}
```

</details>

| Old architecture | New architecture |
|------------------|------------------|
| <img width="447" alt="Screenshot 2024-04-18 at 17 08 59" src="https://github.com/facebook/react-native/assets/21055725/b21848ff-3939-4dde-9f78-03ce50c9429a">            | <img width="447" alt="Screenshot 2024-04-18 at 17 04 46" src="https://github.com/facebook/react-native/assets/21055725/fb57a3c4-09e8-4db7-abc3-79747314529b">          |

Reviewed By: NickGerleman, cipolleschi

Differential Revision: D56361169

Pulled By: cortinico

fbshipit-source-id: c3002f65541774e376e315c3076a6157aa330f8d
2024-04-26 06:54:17 -07:00
Moti Zilberman d6e0bc714a Enable lint/sort-imports everywhere (#41334)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41334

TSIA.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D51025812

fbshipit-source-id: e10d437be775a6b80946483aa96460f34927f870
2023-11-06 12:59:38 -08:00
Sam Zhou 4b97484650 Rollout support for multiplatform react-native project (#39131)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39131

Docs on the new behavior: https://flow.org/en/docs/react/multiplatform

Changelog: [Internal]

Reviewed By: samwgoldman

Differential Revision: D48085422

fbshipit-source-id: daaa5a7d7d04871ab3da1ad47c6b88ef4226bdfd
2023-08-24 09:54:15 -07:00
Sam Zhou 90c0e3be14 Align types for different ios/android implementation files (#38761)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38761

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D48014272

fbshipit-source-id: d70c2b9442cedf87e72be336c7a25372daea8f28
2023-08-02 19:57:12 -07:00
Ana Margarida Silva 6d24ee13a4 fix: apply font size to ReactTextView to fix ellipsis cut (#37248)
Summary:
This PR aims to fix https://github.com/facebook/react-native/issues/36350. In certain cases, when the text is cut due to  `numberOfLines`, the ellipsis appear cut. This is actually an Android bug, which was reported on their side [here](https://issuetracker.google.com/issues/278044456).

This PR contains a workaround for it by applying the text size to the TextView directly instead of just the Spannable inside it. This solves all problems and it seems like it does not cause any regressions.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ANDROID] [FIXED] - Fix ellipsis being cut on certain font sizes

Pull Request resolved: https://github.com/facebook/react-native/pull/37248

Test Plan:
One piece of code where the problem could be replicated would be the one below, running on an Pixel 3A emulator.

```jsx
<Text style={{padding: 27, fontSize: 30}} numberOfLines={1}>
   This text will be cut-off strangely in Android
</Text>
```

RN-tester of the problem:

| Before | With the fix  |
| --------------- | --------------- |
|  <img width="460" alt="Screenshot 2023-05-04 at 12 05 11" src="https://user-images.githubusercontent.com/25725586/236187961-d7841594-2d39-4cdc-aff9-a36f60fe6d15.png">| <img width="460" alt="Screenshot 2023-05-04 at 12 08 07" src="https://user-images.githubusercontent.com/25725586/236187999-e823beb5-0473-4940-894e-b3d2ff02c6cc.png"> |

RN-Tester comparison:
| Before | With the fix  |
| --------------- | --------------- |
| <video src="https://user-images.githubusercontent.com/25725586/234273910-c6a9f55c-9a19-415d-b0cd-477c9087dac2.mp4">  | <video src="https://user-images.githubusercontent.com/25725586/234273973-ba6d5bd5-eba8-4eda-aefb-c926ea28c4e5.mp4"> |

Reviewed By: javache

Differential Revision: D45958303

Pulled By: NickGerleman

fbshipit-source-id: 51f77702a82e60c0c18a29ee46b0aba4f37bcc28
2023-05-20 18:56:11 -07:00
Moti Zilberman d6e9891577 Reduce log level of "unrecognized font family" from Error to Info
Summary:
Changelog:
[iOS][Fixed] - Unrecognized fontFamily values no longer trigger a redbox

## Context

We are starting to roll out a new consistent approach to style errors in React Native, where malformed or semantically invalid style values will never be treated as runtime errors. Instead, bad style values will consistently fall back to known defaults; the incorrect visual rendering will serve as the main runtime diagnostic for developers. We will advise developers to rely on static types for additional diagnostics.

This work will take place over multiple commits and possibly multiple releases of React Native.

## This diff

Here we fix this issue as it applies to the `fontFamily` style prop. The legacy (Paper) renderer on iOS is the only concrete implementation that had to change. Fabric and Android already implement the correct behaviour.

h/t EvanBacon for the report: https://twitter.com/Baconbrix/status/1623039650775371792

Reviewed By: huntie

Differential Revision: D43159284

fbshipit-source-id: 6afeef3abc5781e18671708f642073d25f2347e9
2023-02-09 10:57:50 -08:00
Mike Vitousek 78b599f5b6 Add type arguments to calls to new Array() in xplat
Summary:
This diff adds type parameters to all uses of `new Array`.

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D41746116

fbshipit-source-id: 8aa2777dd13ef4cd9f8613adaa3509d3573d4446
2022-12-06 22:46:38 -08:00
Adam Gleitman 11c8bf3137 Add Dynamic Type support for iOS (Paper and Fabric) (#35017)
Summary:
This adds Dynamic Type support in iOS as described [here](https://github.com/react-native-community/discussions-and-proposals/issues/519).

`Text` elements have a new prop, `dynamicTypeRamp`, that allows users to specify which font ramp a particular `Text` element should take on as the OS's accessibility setting for text size. The different types line up with different values of `UIFontTextStyle`. If not specified, we default to the current behavior.

~~For the moment, this change is only for Paper. I tried applying a corresponding change to Fabric by adding an additional field to [`facebook::react::TextAttributes`](https://github.com/facebook/react-native/blob/main/ReactCommon/react/renderer/attributedstring/TextAttributes.h) and changing [`RCTEffectiveFontSizeMultiplierFromTextAttributes`](https://github.com/facebook/react-native/blob/afb124dcf0cdf0db525acc7cfd2cea2742c64068/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTAttributedTextUtils.mm#L79-L84) to use that new field, but in the process I discovered that this function doesn't seem to ever get called, hence [this bug](https://github.com/facebook/react-native/issues/34990).~~

## Changelog

[iOS] [Added] - Dynamic Type support

Pull Request resolved: https://github.com/facebook/react-native/pull/35017

Test Plan:
Validated with a test page in RNTester. Screenshots follow:

A) Default text size
B) Largest non-accessibility text size
C) Largest accessibility text size, split across two screenshots due to size

| A | B | C |
|-|-|-|
| ![Simulator Screen Shot - iPad (9th generation) - 2022-10-18 at 16 17 08](https://user-images.githubusercontent.com/717674/196562746-c8bbf53d-3c70-4e55-8600-0cfed8aacf5d.png) | ![Simulator Screen Shot - iPad (9th generation) - 2022-10-18 at 16 17 55](https://user-images.githubusercontent.com/717674/196563051-68bb0e34-c573-47ed-8c19-58ae45a7ce2b.png) | ![Simulator Screen Shot - iPad (9th generation) - 2022-10-18 at 16 18 33](https://user-images.githubusercontent.com/717674/196563185-61ede5ee-e79e-4af5-84a7-8f1e230a25f8.png) |
||| ![Simulator Screen Shot - iPad (9th generation) - 2022-10-18 at 16 18 42](https://user-images.githubusercontent.com/717674/196563208-2242efa2-5f24-466d-80f5-eb57a7678a67.png) |

Reviewed By: sammy-SC

Differential Revision: D40779346

Pulled By: NickGerleman

fbshipit-source-id: efc7a8e9810a93afc82c5def97af15a2e8453d90
2022-11-15 19:03:37 -08:00
bang9 048194849b feat(iOS): added lineBreakStrategy attribute to Text/TextInput (#31272)
Summary:
iOS did not support the implementation of Korean word-wrap(line-break) before iOS14.
If the attribute applied, the word-wrap of Korean will works.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Added] -  Line break strategy for Text and TextInput components

Pull Request resolved: https://github.com/facebook/react-native/pull/31272

Test Plan:
1. Test build and run on above iOS 14.
2. Test it does not affect existing text components when set default(none) strategy.
3. Test whether word-wrap works with Korean when set hangul-word strategy.

<img src="https://user-images.githubusercontent.com/26326015/112963967-d7f70c00-9182-11eb-9a34-8c758b80c219.png" width="300" height="" style="max-width:100%;">

Reviewed By: javache

Differential Revision: D39824809

Pulled By: lunaleaps

fbshipit-source-id: 42cb0385221a38c84e80d3494d1bfc1934ecf32b
2022-10-17 13:14:17 -07:00
Gabriel Donadel Dall'Agnol 32b6f319ba feat: Add support for verticalAlign style (#34567)
Summary:
This adds support for the `verticalAlign` style attribute, mapping the already existing `textAlignVertical` attribute as requested on https://github.com/facebook/react-native/issues/34425. This PR also updates the TextExample.android on the RNTester in order to facilitate the manual QA of this.

## Changelog

[Android] [Added] - Add support for verticalAlign style

Pull Request resolved: https://github.com/facebook/react-native/pull/34567

Test Plan:
1. On Android open the RNTester app and navigate to the Text page
2. Check the text alignment through the `Text alignment` section

https://user-images.githubusercontent.com/11707729/188051914-bf15f7eb-e53f-4de5-8033-d1b572352935.mov

Reviewed By: jacdebug

Differential Revision: D39771237

Pulled By: cipolleschi

fbshipit-source-id: d2a81bec1edd8d49a0fcd36a42fea53734909739
2022-10-03 05:57:30 -07:00