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
This commit is contained in:
John Reck
2021-06-10 16:42:26 -04:00
parent 4aa2632f98
commit 7c0a17c042

View File

@@ -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();
if (mState.mRippleStyle == STYLE_SOLID) {
if (active) {
tryRippleEnter();
} else {
tryRippleExit();
}
} else {
tryRippleExit();
}
} else {
if (active) {
startPatternedAnimation();
} else {
exitPatternedAnimation();
if (active) {
startPatternedAnimation();
} else {
exitPatternedAnimation();
}
}
}
}