Remove support for Android API < 23 in ReactTextView (#39666)

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

Since minsdk version was increased to 23, we are deleting code using Android APIs < 23 for class ReactTextView

bypass-github-export-checks

changelog: [Android][Breaking] Remove support for Android API < 23 in ReactTextView

Reviewed By: NickGerleman

Differential Revision: D48545504

fbshipit-source-id: a37d8532f879ff32626b256c9c1386d04e27cbcd
This commit is contained in:
David Vacca
2023-09-29 12:11:24 -07:00
committed by Facebook GitHub Bot
parent 07e885232b
commit 31e16ee90c
@@ -106,9 +106,7 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
// Defaults for these fields:
// https://github.com/aosp-mirror/platform_frameworks_base/blob/master/core/java/android/widget/TextView.java#L1061
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
setBreakStrategy(Layout.BREAK_STRATEGY_SIMPLE);
}
setBreakStrategy(Layout.BREAK_STRATEGY_SIMPLE);
setMovementMethod(getDefaultMovementMethod());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
setJustificationMode(Layout.JUSTIFICATION_MODE_NONE);
@@ -145,10 +143,7 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
setFocusable(View.FOCUSABLE_AUTO);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_NONE);
}
setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_NONE);
updateView(); // call after changing ellipsizeLocation in particular
}
@@ -399,10 +394,8 @@ public class ReactTextView extends AppCompatTextView implements ReactCompoundVie
if (nextTextAlign != getGravityHorizontal()) {
setGravityHorizontal(nextTextAlign);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (getBreakStrategy() != update.getTextBreakStrategy()) {
setBreakStrategy(update.getTextBreakStrategy());
}
if (getBreakStrategy() != update.getTextBreakStrategy()) {
setBreakStrategy(update.getTextBreakStrategy());
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (getJustificationMode() != update.getJustificationMode()) {