summaryrefslogtreecommitdiff
path: root/graphics/java
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2021-06-10 16:42:26 -0400
committerJohn Reck <jreck@google.com>2021-06-10 16:42:26 -0400
commit7c0a17c042f737bb5303e6b1f94baeca47360c5d (patch)
treea749e21dfc47d8956d40933cea67a9ed1e7cc778 /graphics/java
parent4aa2632f9813fc7c651b58f6b9869b5c23ca5bc4 (diff)
Put starting the animation back inside state changed check
Only start or stop the ripple if the state changed. Avoids accidentally starting 2 ripples when the overall state set changed but the state_activated specifically did not. Fixes: 188062293 Test: manual Change-Id: If32f1ee5ad3e7294e2e6924b1a4a0e4070c8bcfc
Diffstat (limited to 'graphics/java')
-rw-r--r--graphics/java/android/graphics/drawable/RippleDrawable.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/graphics/java/android/graphics/drawable/RippleDrawable.java b/graphics/java/android/graphics/drawable/RippleDrawable.java
index 73e65c2ec050..8392f432847b 100644
--- a/graphics/java/android/graphics/drawable/RippleDrawable.java
+++ b/graphics/java/android/graphics/drawable/RippleDrawable.java
@@ -330,18 +330,18 @@ public class RippleDrawable extends LayerDrawable {
private void setRippleActive(boolean active) {
if (mRippleActive != active) {
mRippleActive = active;
- }
- if (mState.mRippleStyle == STYLE_SOLID) {
- if (active) {
- tryRippleEnter();
- } else {
- tryRippleExit();
- }
- } else {
- if (active) {
- startPatternedAnimation();
+ if (mState.mRippleStyle == STYLE_SOLID) {
+ if (active) {
+ tryRippleEnter();
+ } else {
+ tryRippleExit();
+ }
} else {
- exitPatternedAnimation();
+ if (active) {
+ startPatternedAnimation();
+ } else {
+ exitPatternedAnimation();
+ }
}
}
}