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:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user