diff options
author | Senpo Hu <senpo@google.com> | 2015-01-02 11:31:08 -0800 |
---|---|---|
committer | Senpo Hu <senpo@google.com> | 2015-01-07 11:39:59 -0800 |
commit | daea74c9c1708908ae801d53ef3288500cc9532f (patch) | |
tree | d0d3fcfe365ed4638dd07a26e3cbbdef94a45acf /src/com/android/camera/widget | |
parent | 9ad0984f36ff9cd133c61c4e979032988b77a995 (diff) | |
download | android_packages_apps_Camera2-daea74c9c1708908ae801d53ef3288500cc9532f.tar.gz android_packages_apps_Camera2-daea74c9c1708908ae801d53ef3288500cc9532f.tar.bz2 android_packages_apps_Camera2-daea74c9c1708908ae801d53ef3288500cc9532f.zip |
Fix NPE crash in RoundedThumbnailView.
Bug: 18851937
Change-Id: I63f3084cd2ae7cd8bbb73507aefcf4192ed7bfd0
Diffstat (limited to 'src/com/android/camera/widget')
-rw-r--r-- | src/com/android/camera/widget/RoundedThumbnailView.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/camera/widget/RoundedThumbnailView.java b/src/com/android/camera/widget/RoundedThumbnailView.java index f47781a30..5b9e3edeb 100644 --- a/src/com/android/camera/widget/RoundedThumbnailView.java +++ b/src/com/android/camera/widget/RoundedThumbnailView.java @@ -353,11 +353,11 @@ public class RoundedThumbnailView extends View { // Stop currently running animators. if (mThumbnailAnimatorSet != null && mThumbnailAnimatorSet.isRunning()) { mThumbnailAnimatorSet.removeAllListeners(); - mThumbnailAnimatorSet.end(); + mThumbnailAnimatorSet.cancel(); } if (mRippleAnimator != null && mRippleAnimator.isRunning()) { mRippleAnimator.removeAllListeners(); - mRippleAnimator.end(); + mRippleAnimator.cancel(); } // Remove all pending reveal requests. mRevealRequestWaitQueue.clear(); @@ -435,7 +435,7 @@ public class RoundedThumbnailView extends View { mThumbnailAnimatorSet.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { - // Mark the thumbnail animation is finished. + // Mark the thumbnail animation as finished. mActiveRevealRequest.finishThumbnailAnimation(); // Process the next reveal request if both thumbnail animation and ripple // animation are both finished. @@ -471,7 +471,10 @@ public class RoundedThumbnailView extends View { mRippleAnimator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { + // Mark the ripple animation as finished. mActiveRevealRequest.finishRippleAnimation(); + // Process the next reveal request if both thumbnail animation and ripple + // animation are both finished. if (mActiveRevealRequest.isFinished()) { mFinishedRevealRequest = mActiveRevealRequest; mActiveRevealRequest = null; |