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

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

Reviewed By: NickGerleman

Differential Revision: D48545508

fbshipit-source-id: 6b781bc1034366658bda608926077c15e4bc0765
  • Loading branch information
mdvacca committed Sep 27, 2023
1 parent 5e3de4d commit ba4d89d
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 ba4d89d

Please sign in to comment.