diff options
author | John Reck <jreck@google.com> | 2014-07-07 09:50:32 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2014-07-07 18:04:44 +0000 |
commit | 32fb6307de7c3ee9399a39dc6734f1c82ffd1dcb (patch) | |
tree | b9441b80b3209a4817c1f94d51f9254907c4859c /libs/hwui/Animator.cpp | |
parent | 657bb84593824196eac46366d15d99b1fd6580d1 (diff) |
Fix VPA.cancel()
Bug: 15978905
Need to make sure we re-sync the UI properties on animator cancel, also
don't animate for 1 frame after cancel() is called
Change-Id: Ib660c0fb195b9f02bd795d03d43ea67bffebb499
Diffstat (limited to 'libs/hwui/Animator.cpp')
-rw-r--r-- | libs/hwui/Animator.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/hwui/Animator.cpp b/libs/hwui/Animator.cpp index f3ef48b18edb..d35dce92b600 100644 --- a/libs/hwui/Animator.cpp +++ b/libs/hwui/Animator.cpp @@ -126,6 +126,9 @@ bool BaseRenderNodeAnimator::animate(TreeInfo& info) { if (mPlayState < RUNNING) { return false; } + if (mPlayState == FINISHED) { + return true; + } // If BaseRenderNodeAnimator is handling the delay (not typical), then // because the staging properties reflect the final value, we always need @@ -209,6 +212,10 @@ void RenderPropertyAnimator::onAttached() { void RenderPropertyAnimator::onStagingPlayStateChanged() { if (mStagingPlayState == RUNNING) { (mTarget->mutateStagingProperties().*mPropertyAccess->setter)(finalValue()); + } else if (mStagingPlayState == FINISHED) { + // We're being canceled, so make sure that whatever values the UI thread + // is observing for us is pushed over + mTarget->setPropertyFieldsDirty(dirtyMask()); } } |