From 120aab2e995d341e5f620475c7f2beaf61e47f5e Mon Sep 17 00:00:00 2001 From: David Vacca Date: Fri, 29 Sep 2023 12:11:24 -0700 Subject: [PATCH] Remove support for Android API < 23 in ReactDrawableHelper (#39667) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/39667 Since minsdk version was increased to 23, we are deleting code using Android APIs < 23 for class ReactDrawableHelper bypass-github-export-checks changelog: [Android][Breaking] Remove support for Android API < 23 in ReactDrawableHelper Reviewed By: NickGerleman Differential Revision: D48545508 fbshipit-source-id: df15ad8dcf0ec94abd8291b8cb180be18771809d --- .../com/facebook/react/views/view/ReactDrawableHelper.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactDrawableHelper.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactDrawableHelper.java index 2c6107e47358f4..e67e2f74d21f77 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactDrawableHelper.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactDrawableHelper.java @@ -13,7 +13,6 @@ import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.RippleDrawable; -import android.os.Build; import android.util.TypedValue; import androidx.annotation.Nullable; import com.facebook.react.bridge.JSApplicationIllegalArgumentException; @@ -76,9 +75,7 @@ private static RippleDrawable getRippleDrawable( } private static Drawable setRadius(ReadableMap drawableDescriptionDict, Drawable drawable) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M - && drawableDescriptionDict.hasKey("rippleRadius") - && drawable instanceof RippleDrawable) { + if (drawableDescriptionDict.hasKey("rippleRadius") && drawable instanceof RippleDrawable) { RippleDrawable rippleDrawable = (RippleDrawable) drawable; double rippleRadius = drawableDescriptionDict.getDouble("rippleRadius"); rippleDrawable.setRadius((int) PixelUtil.toPixelFromDIP(rippleRadius));