Skip to content

Commit

Permalink
Remove support for Android API < 23 in ReactTextView (#39666)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
mdvacca authored and facebook-github-bot committed Sep 29, 2023
1 parent 07e8852 commit 31e16ee
Showing 1 changed file with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ private void initView() {

// 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);
Expand Down Expand Up @@ -145,10 +143,7 @@ private void initView() {
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
}

Expand Down Expand Up @@ -399,10 +394,8 @@ public void setText(ReactTextUpdate update) {
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()) {
Expand Down

0 comments on commit 31e16ee

Please sign in to comment.