mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
24b2a66145
Summary: [Android] [Fixed] - Use HYPHENATION_FREQUENCY_NONE instead of HYPHENATION_FREQUENCY_NORMAL to measure text The text must be measured with HYPHENATION_FREQUENCY_NONE instead of HYPHENATION_FREQUENCY_NORMAL, since ReactTextView has hyphenation frequency set to HYPHENATION_FREQUENCY_NONE. These two values must match, otherwise the measured height of text we return from the Yoga measure function might be wrong. Even though the TextView [documentation](https://developer.android.com/reference/android/widget/TextView#setHyphenationFrequency(int)) says that the default hyphenation frequency is HYPHENATION_FREQUENCY_NORMAL before Android Q, it's not true for TextViews instantiated in code (the default value is set from the theme which is missing in case of ReactTextView). See the screenshots below where the text is measured incorrectly which causes the last line to be cut off. I extracted the value to a class member variable because I'm planning to expose the hyphenationFrequency prop for the Text component so that it can be configured on Android (as requested by this Github issue: https://github.com/facebook/react-native/issues/17199). Reviewed By: shergin Differential Revision: D16109430 fbshipit-source-id: 278c8182c0f819be27bc1d2468559b9e9ae1f807
Building React Native for Android
See the docs on the website.
Running tests
When you submit a pull request CircleCI will automatically run all tests. To run tests locally, see Testing.