Loading core/java/android/animation/LayoutTransition.java +20 −1 Original line number Diff line number Diff line Loading @@ -793,7 +793,9 @@ public class LayoutTransition { * @hide */ public void startChangingAnimations() { for (Animator anim : currentChangingAnimations.values()) { LinkedHashMap<View, Animator> currentAnimCopy = (LinkedHashMap<View, Animator>) currentChangingAnimations.clone(); for (Animator anim : currentAnimCopy.values()) { if (anim instanceof ObjectAnimator) { ((ObjectAnimator) anim).setCurrentPlayTime(0); } Loading @@ -801,6 +803,23 @@ public class LayoutTransition { } } /** * Ends the animations that are set up for a CHANGING transition. This is a variant of * startChangingAnimations() which is called when the window the transition is playing in * is not visible. We need to make sure the animations put their targets in their end states * and that the transition finishes to remove any mid-process state (such as isRunning()). * * @hide */ public void endChangingAnimations() { LinkedHashMap<View, Animator> currentAnimCopy = (LinkedHashMap<View, Animator>) currentChangingAnimations.clone(); for (Animator anim : currentAnimCopy.values()) { anim.start(); anim.end(); } } /** * Returns true if animations are running which animate layout-related properties. This * essentially means that either CHANGE_APPEARING or CHANGE_DISAPPEARING animations Loading core/java/android/view/ViewRootImpl.java +13 −7 Original line number Diff line number Diff line Loading @@ -1575,13 +1575,13 @@ public final class ViewRootImpl extends Handler implements ViewParent, boolean cancelDraw = attachInfo.mTreeObserver.dispatchOnPreDraw() || viewVisibility != View.VISIBLE; if (!cancelDraw && !newSurface) { if (mPendingTransitions != null && mPendingTransitions.size() > 0) { for (int i = 0; i < mPendingTransitions.size(); ++i) { mPendingTransitions.get(i).startChangingAnimations(); } mPendingTransitions.clear(); } if (!cancelDraw && !newSurface) { mFullRedrawNeeded = false; final long drawStartTime; Loading Loading @@ -1619,7 +1619,13 @@ public final class ViewRootImpl extends Handler implements ViewParent, } } } else { // End any pending transitions on this non-visible window if (mPendingTransitions != null && mPendingTransitions.size() > 0) { for (int i = 0; i < mPendingTransitions.size(); ++i) { mPendingTransitions.get(i).endChangingAnimations(); } mPendingTransitions.clear(); } // We were supposed to report when we are done drawing. Since we canceled the // draw, remember it here. if ((relayoutResult&WindowManagerImpl.RELAYOUT_FIRST_TIME) != 0) { Loading Loading
core/java/android/animation/LayoutTransition.java +20 −1 Original line number Diff line number Diff line Loading @@ -793,7 +793,9 @@ public class LayoutTransition { * @hide */ public void startChangingAnimations() { for (Animator anim : currentChangingAnimations.values()) { LinkedHashMap<View, Animator> currentAnimCopy = (LinkedHashMap<View, Animator>) currentChangingAnimations.clone(); for (Animator anim : currentAnimCopy.values()) { if (anim instanceof ObjectAnimator) { ((ObjectAnimator) anim).setCurrentPlayTime(0); } Loading @@ -801,6 +803,23 @@ public class LayoutTransition { } } /** * Ends the animations that are set up for a CHANGING transition. This is a variant of * startChangingAnimations() which is called when the window the transition is playing in * is not visible. We need to make sure the animations put their targets in their end states * and that the transition finishes to remove any mid-process state (such as isRunning()). * * @hide */ public void endChangingAnimations() { LinkedHashMap<View, Animator> currentAnimCopy = (LinkedHashMap<View, Animator>) currentChangingAnimations.clone(); for (Animator anim : currentAnimCopy.values()) { anim.start(); anim.end(); } } /** * Returns true if animations are running which animate layout-related properties. This * essentially means that either CHANGE_APPEARING or CHANGE_DISAPPEARING animations Loading
core/java/android/view/ViewRootImpl.java +13 −7 Original line number Diff line number Diff line Loading @@ -1575,13 +1575,13 @@ public final class ViewRootImpl extends Handler implements ViewParent, boolean cancelDraw = attachInfo.mTreeObserver.dispatchOnPreDraw() || viewVisibility != View.VISIBLE; if (!cancelDraw && !newSurface) { if (mPendingTransitions != null && mPendingTransitions.size() > 0) { for (int i = 0; i < mPendingTransitions.size(); ++i) { mPendingTransitions.get(i).startChangingAnimations(); } mPendingTransitions.clear(); } if (!cancelDraw && !newSurface) { mFullRedrawNeeded = false; final long drawStartTime; Loading Loading @@ -1619,7 +1619,13 @@ public final class ViewRootImpl extends Handler implements ViewParent, } } } else { // End any pending transitions on this non-visible window if (mPendingTransitions != null && mPendingTransitions.size() > 0) { for (int i = 0; i < mPendingTransitions.size(); ++i) { mPendingTransitions.get(i).endChangingAnimations(); } mPendingTransitions.clear(); } // We were supposed to report when we are done drawing. Since we canceled the // draw, remember it here. if ((relayoutResult&WindowManagerImpl.RELAYOUT_FIRST_TIME) != 0) { Loading