Bug
27788719
The end action of a ViewPropertyAnimator may do anything,
including starting a new animator. If the next animator has
started prior to cleaning up the previous one, it will capture
the dirty state as the final state. This CL runs the cleanup
Runnables before running the end actions so that any captured
state is the clean state.
Change-Id: Ib005b817d420e79b636e61987669a852e15df9ce
if (mListener != null) {
mListener.onAnimationEnd(animation);
}
- if (mAnimatorOnEndMap != null) {
- Runnable r = mAnimatorOnEndMap.get(animation);
+ if (mAnimatorCleanupMap != null) {
+ Runnable r = mAnimatorCleanupMap.get(animation);
if (r != null) {
r.run();
}
- mAnimatorOnEndMap.remove(animation);
+ mAnimatorCleanupMap.remove(animation);
}
- if (mAnimatorCleanupMap != null) {
- Runnable r = mAnimatorCleanupMap.get(animation);
+ if (mAnimatorOnEndMap != null) {
+ Runnable r = mAnimatorOnEndMap.get(animation);
if (r != null) {
r.run();
}
- mAnimatorCleanupMap.remove(animation);
+ mAnimatorOnEndMap.remove(animation);
}
mAnimatorMap.remove(animation);
}