Skip to content

Commit

Permalink
Remove support for Android API < 23 in ReactDrawableHelper (facebook#…
Browse files Browse the repository at this point in the history
…39667)

Summary:
Pull Request resolved: facebook#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
  • Loading branch information
mdvacca committed Sep 27, 2023
1 parent a6c01fc commit eac3ae6
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 eac3ae6

Please sign in to comment.