From 2086710f58032d8ea2dfd7b6e514954d4aab498f Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Wed, 10 Dec 2014 17:09:17 +0100 Subject: [PATCH] Fixed a bug where the empty shade and dismiss views would animate This lead to an ugly flash when turning the screen off and on again. Bug: 18657280 Change-Id: I5ca572239639bf3c95c106ba193a268e0256df38 --- .../stack/NotificationStackScrollLayout.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index 2a393bf0d75fe..6dcbed6f68d28 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -2280,8 +2280,7 @@ public class NotificationStackScrollLayout extends ViewGroup updateContentHeight(); notifyHeightChangeListener(mDismissView); } else { - mEmptyShadeView.setWillBeGone(true); - mEmptyShadeView.performVisibilityAnimation(false, new Runnable() { + Runnable onFinishedRunnable = new Runnable() { @Override public void run() { mEmptyShadeView.setVisibility(GONE); @@ -2289,7 +2288,14 @@ public class NotificationStackScrollLayout extends ViewGroup updateContentHeight(); notifyHeightChangeListener(mDismissView); } - }); + }; + if (mAnimationsEnabled) { + mEmptyShadeView.setWillBeGone(true); + mEmptyShadeView.performVisibilityAnimation(false, onFinishedRunnable); + } else { + mEmptyShadeView.setInvisible(); + onFinishedRunnable.run(); + } } } } @@ -2318,7 +2324,7 @@ public class NotificationStackScrollLayout extends ViewGroup notifyHeightChangeListener(mDismissView); } }; - if (mDismissView.isButtonVisible() && mIsExpanded) { + if (mDismissView.isButtonVisible() && mIsExpanded && mAnimationsEnabled) { mDismissView.setWillBeGone(true); mDismissView.performVisibilityAnimation(false, dimissHideFinishRunnable); } else {