summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com
diff options
context:
space:
mode:
authorSelim Cinek <cinek@google.com>2014-05-01 21:55:31 +0200
committerSelim Cinek <cinek@google.com>2014-05-01 23:09:41 +0200
commitf4c1996d015a3c74e00c6ef72968f90f615a4bf7 (patch)
tree474a7b48e885848390bfd9006d2a3645fa80637f /packages/SystemUI/src/com
parent5f81193f801f77c0c00bcc4f65a68bd995e7b954 (diff)
downloadframeworks_base-f4c1996d015a3c74e00c6ef72968f90f615a4bf7.zip
frameworks_base-f4c1996d015a3c74e00c6ef72968f90f615a4bf7.tar.gz
frameworks_base-f4c1996d015a3c74e00c6ef72968f90f615a4bf7.tar.bz2
Fixed a bug when a notification was quickly added and removed.
Change-Id: Id9b1cb771a2b6d1f42b61ef40a637e15c8d8f3b7
Diffstat (limited to 'packages/SystemUI/src/com')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java26
1 files changed, 17 insertions, 9 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 0e75acd..18677b2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -265,11 +265,8 @@ public class NotificationStackScrollLayout extends ViewGroup
mStackScrollAlgorithm.getStackScrollState(mCurrentStackScrollState);
if (!isCurrentlyAnimating() && !mChildHierarchyDirty) {
applyCurrentState();
- if (mListener != null) {
- mListener.onChildLocationsChanged(this);
- }
} else {
- startAnimationToState(mCurrentStackScrollState);
+ startAnimationToState();
}
}
@@ -831,9 +828,13 @@ public class NotificationStackScrollLayout extends ViewGroup
updateScrollStateForRemovedChild(child);
if (mIsExpanded) {
- // Generate Animations
- mChildrenToRemoveAnimated.add(child);
- mChildHierarchyDirty = true;
+ if (!mChildrenToAddAnimated.contains(child)) {
+ // Generate Animations
+ mChildrenToRemoveAnimated.add(child);
+ mChildHierarchyDirty = true;
+ } else {
+ mChildrenToAddAnimated.remove(child);
+ }
}
}
@@ -905,12 +906,16 @@ public class NotificationStackScrollLayout extends ViewGroup
}
}
- private void startAnimationToState(StackScrollState finalState) {
+ private void startAnimationToState() {
if (mChildHierarchyDirty) {
generateChildHierarchyEvents();
mChildHierarchyDirty = false;
}
- mStateAnimator.startAnimationForEvents(mAnimationEvents, finalState);
+ if (!mAnimationEvents.isEmpty()) {
+ mStateAnimator.startAnimationForEvents(mAnimationEvents, mCurrentStackScrollState);
+ } else {
+ applyCurrentState();
+ }
}
private void generateChildHierarchyEvents() {
@@ -1128,6 +1133,9 @@ public class NotificationStackScrollLayout extends ViewGroup
mListenForHeightChanges = false;
mCurrentStackScrollState.apply();
mListenForHeightChanges = true;
+ if (mListener != null) {
+ mListener.onChildLocationsChanged(this);
+ }
}
/**