From a0d30b848a07480d0fccec608a62a505c71f8cac Mon Sep 17 00:00:00 2001 From: Genki Kondo Date: Thu, 26 Aug 2021 10:38:36 -0700 Subject: [PATCH] Remove unsupported values for android_hyphenationFrequency Summary: hyphenationStrategy must be one of one of Layout#HYPHENATION_FREQUENCY_NONE, Layout#HYPHENATION_FREQUENCY_NORMAL, Layout#HYPHENATION_FREQUENCY_FULL: (https://developer.android.com/reference/android/widget/TextView#setHyphenationFrequency(int)) Thus "high" and "balanced" are not only redundant, but actually don't do what the value indicates - Layout#BREAK_STRATEGY_BALANCED (constant value: 2) and Layout#BREAK_STRATEGY_HIGH_QUALITY (constant value: 1) are only meant to be used for android:breakStrategy Changelog: [Android][Changed] - Remove `"high"` and `"balanced"` as values for `android_hyphenationFrequency` on `Text` Reviewed By: JoshuaGross Differential Revision: D30531096 fbshipit-source-id: 1a0b6e733bb21ce6b2f104a2025a79c16de3cfea --- Libraries/Text/TextProps.js | 8 +------- .../views/text/ReactTextAnchorViewManager.java | 4 ---- .../js/examples/Text/TextExample.android.js | 14 +++----------- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/Libraries/Text/TextProps.js b/Libraries/Text/TextProps.js index b2a39e58df7..3942a5998cd 100644 --- a/Libraries/Text/TextProps.js +++ b/Libraries/Text/TextProps.js @@ -66,13 +66,7 @@ export type TextProps = $ReadOnly<{| * Set hyphenation strategy on Android. * */ - android_hyphenationFrequency?: ?( - | 'normal' - | 'none' - | 'full' - | 'high' - | 'balanced' - ), + android_hyphenationFrequency?: ?('normal' | 'none' | 'full'), children?: ?Node, /** diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java index ffc8655c0a4..6ee067cb661 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextAnchorViewManager.java @@ -110,10 +110,6 @@ public abstract class ReactTextAnchorViewManager { Normal: - WillHaveAnHyphenWhenBreakingForNewLine + WillHaveAHyphenWhenBreakingForNewLine None: - WillNotHaveAnHyphenWhenBreakingForNewLine + WillNotHaveAHyphenWhenBreakingForNewLine Full: - WillHaveAnHyphenWhenBreakingForNewLine - - - High: - WillHaveAnHyphenWhenBreakingForNewLine - - - Balanced: - WillHaveAnHyphenWhenBreakingForNewLine + WillHaveAHyphenWhenBreakingForNewLine