OSDN Git Service

Clear ripple animations on cancel/end
authorAlan Viverette <alanv@google.com>
Thu, 4 Sep 2014 19:16:40 +0000 (12:16 -0700)
committerAlan Viverette <alanv@google.com>
Thu, 4 Sep 2014 19:16:40 +0000 (12:16 -0700)
This prevents subsequent calls to end() from snapping the background
opacity (among others) back to 1.

BUG: 17357749
BUG: 17349157
Change-Id: I2a4870ed588ba98986428983bf29b556cdc9a701

graphics/java/android/graphics/drawable/Ripple.java
graphics/java/android/graphics/drawable/RippleBackground.java

index cd919a6..43922b8 100644 (file)
@@ -419,18 +419,22 @@ class Ripple {
     private void endSoftwareAnimations() {
         if (mAnimRadius != null) {
             mAnimRadius.end();
+            mAnimRadius = null;
         }
 
         if (mAnimOpacity != null) {
             mAnimOpacity.end();
+            mAnimOpacity = null;
         }
 
         if (mAnimX != null) {
             mAnimX.end();
+            mAnimX = null;
         }
 
         if (mAnimY != null) {
             mAnimY.end();
+            mAnimY = null;
         }
     }
 
@@ -506,18 +510,22 @@ class Ripple {
     private void cancelSoftwareAnimations() {
         if (mAnimRadius != null) {
             mAnimRadius.cancel();
+            mAnimRadius = null;
         }
 
         if (mAnimOpacity != null) {
             mAnimOpacity.cancel();
+            mAnimOpacity = null;
         }
 
         if (mAnimX != null) {
             mAnimX.cancel();
+            mAnimX = null;
         }
 
         if (mAnimY != null) {
             mAnimY.cancel();
+            mAnimY = null;
         }
     }
 
index 4e68a60..80ecea3 100644 (file)
@@ -326,6 +326,7 @@ class RippleBackground {
     private void endSoftwareAnimations() {
         if (mAnimOuterOpacity != null) {
             mAnimOuterOpacity.end();
+            mAnimOuterOpacity = null;
         }
     }
 
@@ -413,6 +414,7 @@ class RippleBackground {
     private void cancelSoftwareAnimations() {
         if (mAnimOuterOpacity != null) {
             mAnimOuterOpacity.cancel();
+            mAnimOuterOpacity = null;
         }
     }