summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2011-09-02 15:37:25 -0700
committerChet Haase <chet@google.com>2011-09-02 16:10:43 -0700
commit3c4ce72c4d66d9ee041924259f20381b658c1529 (patch)
treecd8de3d0328d1d0da7442d92797604c3e30818fc
parentf743338c1ed6d84c1feea9888ee19755be0ba9f6 (diff)
downloadframeworks_base-3c4ce72c4d66d9ee041924259f20381b658c1529.zip
frameworks_base-3c4ce72c4d66d9ee041924259f20381b658c1529.tar.gz
frameworks_base-3c4ce72c4d66d9ee041924259f20381b658c1529.tar.bz2
Fix artifact with LayoutTransitions on disappearing window.
Logic in performTraversals() starts a transition running at the proper time. But when a view's parent window goes away, this transition may not start at that time because drawing gets canceled. But the transition still hung off of the ViewRoot, waiting until some later drawing operation to kick it off. This resulted in some weird animations like the Recents panel appearing and having a single item animate off of it. The fix is to delete pending transitions when drawing is skipped. Change-Id: I3ab7702c16e069644a163424f977350743e2cecc
-rw-r--r--core/java/android/animation/ObjectAnimator.java2
-rw-r--r--core/java/android/view/ViewRootImpl.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java2
3 files changed, 7 insertions, 2 deletions
diff --git a/core/java/android/animation/ObjectAnimator.java b/core/java/android/animation/ObjectAnimator.java
index 31c5f8d..d2d66b6 100644
--- a/core/java/android/animation/ObjectAnimator.java
+++ b/core/java/android/animation/ObjectAnimator.java
@@ -351,7 +351,7 @@ public final class ObjectAnimator extends ValueAnimator {
@Override
public void start() {
if (DBG) {
- Log.d("ObjectAnimator", "Anim target, duration" + mTarget + ", " + getDuration());
+ Log.d("ObjectAnimator", "Anim target, duration: " + mTarget + ", " + getDuration());
for (int i = 0; i < mValues.length; ++i) {
PropertyValuesHolder pvh = mValues[i];
ArrayList<Keyframe> keyframes = pvh.mKeyframeSet.mKeyframes;
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 7db1b32..7ca8174 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -1599,6 +1599,11 @@ public final class ViewRootImpl extends Handler implements ViewParent,
}
}
} else {
+ // If we're not drawing, then we don't need to draw the transitions, either
+ if (mPendingTransitions != null) {
+ 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) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
index 4a1cafd..510fd3b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
@@ -147,7 +147,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
public boolean onPreDraw() {
getViewTreeObserver().removeOnPreDrawListener(this);
mChoreo.startAnimation(true);
- return true;
+ return false;
}
};