From 36ee87511950dd915247c735d207a58e2a07ab33 Mon Sep 17 00:00:00 2001 From: David Vacca <515103+mdvacca@users.noreply.github.com> Date: Wed, 27 Sep 2023 18:02:17 -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 changelog: [Android][Breaking] Remove support for Android API < 23 in ReactDrawableHelper Reviewed By: NickGerleman Differential Revision: D48545508 fbshipit-source-id: 50aa2ddb6e7d4788072b2c0bb17dfcc8b852cf80 --- .../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));