You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't create a RippleDrawable when the color is transparent (#2575)
## Description
When the `GestureHandlerButton` was disabled immediately after clicking
it, the ripple animation would show even if its color was set to
transparent. This PR updates the background creation logic not to create
the `RippleDrawable` when its color would be transparent, which prevents
the issue from happening.
It also removes some unnecessary SDK version checks, since RN 0.64 is
the last supported version starting with Gesture Handler 2.10.0
## Test plan
Tested on the snippet from
#2418 (comment)
// Since Android 13, alpha channel in RippleDrawable is clamped between [128, 255]
250
-
// see https://github.com/aosp-mirror/platform_frameworks_base/blob/c1bd0480261460584753508327ca8a0c6fc80758/graphics/java/android/graphics/drawable/RippleDrawable.java#L1012
251
-
if (rippleColor ==Color.TRANSPARENT&&Build.VERSION.SDK_INT>=Build.VERSION_CODES.TIRAMISU) {
242
+
// don't create ripple drawable at all when it's not supposed to be visible
0 commit comments