Skip to content

Commit

Permalink
Remove support for Android API < 23 in ReactDrawableHelper (#39667)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
mdvacca authored and facebook-github-bot committed Sep 29, 2023
1 parent dc3fc16 commit 120aab2
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 120aab2

Please sign in to comment.