Skip to content

Commit

Permalink
Remove support for Android API < 23 in ReactTextInputShadowNode
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 ReactTextInputShadowNode

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

Differential Revision: D48545503

fbshipit-source-id: bb7264fca26de5d06b74394538fbde8aeb63c7f5
  • Loading branch information
mdvacca authored and facebook-github-bot committed Sep 27, 2023
1 parent 2a57436 commit 5e3de4d
Showing 1 changed file with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

package com.facebook.react.views.textinput;

import android.annotation.TargetApi;
import android.os.Build;
import android.text.Layout;
import android.util.TypedValue;
import android.view.ViewGroup;
Expand All @@ -35,7 +33,6 @@
import com.facebook.yoga.YogaNode;

@VisibleForTesting
@TargetApi(Build.VERSION_CODES.M)
public class ReactTextInputShadowNode extends ReactBaseTextShadowNode
implements YogaMeasureFunction {

Expand All @@ -53,10 +50,7 @@ public class ReactTextInputShadowNode extends ReactBaseTextShadowNode
public ReactTextInputShadowNode(
@Nullable ReactTextViewManagerCallback reactTextViewManagerCallback) {
super(reactTextViewManagerCallback);
mTextBreakStrategy =
(Build.VERSION.SDK_INT < Build.VERSION_CODES.M)
? Layout.BREAK_STRATEGY_SIMPLE
: Layout.BREAK_STRATEGY_HIGH_QUALITY;
mTextBreakStrategy = Layout.BREAK_STRATEGY_HIGH_QUALITY;

initMeasureFunction();
}
Expand Down Expand Up @@ -118,8 +112,7 @@ public long measure(
editText.setLines(mNumberOfLines);
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
&& editText.getBreakStrategy() != mTextBreakStrategy) {
if (editText.getBreakStrategy() != mTextBreakStrategy) {
editText.setBreakStrategy(mTextBreakStrategy);
}
}
Expand Down Expand Up @@ -182,10 +175,6 @@ public void setPlaceholder(@Nullable String placeholder) {

@Override
public void setTextBreakStrategy(@Nullable String textBreakStrategy) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
return;
}

if (textBreakStrategy == null || "simple".equals(textBreakStrategy)) {
mTextBreakStrategy = Layout.BREAK_STRATEGY_SIMPLE;
} else if ("highQuality".equals(textBreakStrategy)) {
Expand Down

0 comments on commit 5e3de4d

Please sign in to comment.