Skip to content

Commit

Permalink
Remove support for Android API < 23 in ReactTextView
Browse files Browse the repository at this point in the history
Summary:
Since minsdk version was increased to 23, we are deleting code using Android APIs < 23 for class ReactTextView

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

Differential Revision: D48545504

fbshipit-source-id: 7eb8abcaf48c1c8a1454ef1191f6dd07c1389613
  • Loading branch information
mdvacca authored and facebook-github-bot committed Sep 29, 2023
1 parent eb439ba commit b68f758
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 b68f758

Please sign in to comment.