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