Fix measuring text with incorrect hyphenationFrequency

Summary:
A typo means TextLayoutManager will incorrectly measure text as if `LineBreaker.HYPHENATION_FREQUENCY_NORMAL` is set, instead of the correct default of `LineBreaker.HYPHENATION_FREQUENCY_NONE` which we use to display the `TextView`. This causes truncation if hyphenation would have caused text to be shorter than if not hyphenated. Fix the typo.

Changelog: [Android][Fixed] - Fix measuring text with incorrect hyphenationFrequency

Reviewed By: mellyeliu

Differential Revision: D63293027

fbshipit-source-id: baaf2ae2676548cf0815ae96e324af273be6f99e
This commit is contained in:
Nick Gerleman
2024-09-30 14:27:39 +01:00
committed by Blake Friedman
parent cffeb603de
commit ba7fca8cbd
@@ -446,7 +446,7 @@ public class TextLayoutManager {
? paragraphAttributes.getBoolean(PA_KEY_INCLUDE_FONT_PADDING)
: DEFAULT_INCLUDE_FONT_PADDING;
int hyphenationFrequency =
TextAttributeProps.getTextBreakStrategy(
TextAttributeProps.getHyphenationFrequency(
paragraphAttributes.getString(PA_KEY_HYPHENATION_FREQUENCY));
boolean adjustFontSizeToFit =
paragraphAttributes.contains(PA_KEY_ADJUST_FONT_SIZE_TO_FIT)