Merge "Fix NPE when ripples are canceled due to visibility change" into lmp-preview-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
40646c5c6a
@@ -441,8 +441,11 @@ public class RippleDrawable extends LayerDrawable {
|
||||
final int count = mAnimatingRipplesCount;
|
||||
final Ripple[] ripples = mAnimatingRipples;
|
||||
for (int i = 0; i < count; i++) {
|
||||
ripples[i].cancel();
|
||||
// Calling cancel may remove the ripple from the animating ripple
|
||||
// array, so cache the reference before nulling it out.
|
||||
final Ripple ripple = ripples[i];
|
||||
ripples[i] = null;
|
||||
ripple.cancel();
|
||||
}
|
||||
|
||||
mAnimatingRipplesCount = 0;
|
||||
|
||||
Reference in New Issue
Block a user