BUG:
16651728
Change-Id: Ibe413eabf9644c2ac9a5c8c1418ff996dacf606a
}
private void clearHotspots() {
- if (mRipple != null) {
- mRipple.cancel();
- mRipple = null;
- }
-
- if (mBackground != null) {
- mBackground.cancel();
- mBackground = null;
- }
-
final int count = mAnimatingRipplesCount;
final Ripple[] ripples = mAnimatingRipples;
for (int i = 0; i < count; i++) {
final Ripple ripple = ripples[i];
ripples[i] = null;
ripple.cancel();
+
+ // The active ripple may also be animating. Don't cancel it twice.
+ if (mRipple == ripple) {
+ mRipple = null;
+ }
+ }
+
+ if (mRipple != null) {
+ mRipple.cancel();
+ mRipple = null;
+ }
+
+ if (mBackground != null) {
+ mBackground.cancel();
+ mBackground = null;
}
mAnimatingRipplesCount = 0;