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

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

Reviewed By: NickGerleman

Differential Revision: D48545508

fbshipit-source-id: ff9e0b5f7686b425995983caf35e2aa049aee7e3
  • Loading branch information
mdvacca committed Sep 29, 2023
1 parent 62f19a5 commit 87cb6ba
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 87cb6ba

Please sign in to comment.