summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Selim Cinek <cinek@google.com> 2014-06-04 20:39:55 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2014-06-04 20:39:56 +0000
commit1bb443724bcf080f3acab39172096b85b04741c2 (patch)
tree20126e0ea1fdb292b814cd5b0aa2fc8df65c6a67
parentb2be801f07fd56dab709ca0e0a02bfe6485b2506 (diff)
parent159ffdbf0018d14222e2b378f69efbe739244d43 (diff)
Merge "Fixed an animation bug" into lmp-preview-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java13
1 files changed, 9 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 c29f1059e682..038370606985 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -108,6 +108,7 @@ public class NotificationStackScrollLayout extends ViewGroup
private ArrayList<View> mSwipedOutViews = new ArrayList<View>();
private final StackStateAnimator mStateAnimator = new StackStateAnimator(this);
private boolean mAnimationsEnabled;
+ private boolean mChangePositionInProgress;
/**
* The raw amount of the overScroll on the top, which is not rubber-banded.
@@ -1318,7 +1319,7 @@ public class NotificationStackScrollLayout extends ViewGroup
protected void onViewRemoved(View child) {
super.onViewRemoved(child);
mStackScrollAlgorithm.notifyChildrenChanged(this);
- if (mChildrenChangingPositions.contains(child)) {
+ if (mChangePositionInProgress) {
// This is only a position change, don't do anything special
return;
}
@@ -1413,7 +1414,7 @@ public class NotificationStackScrollLayout extends ViewGroup
* @param child The view to be added.
*/
public void generateAddAnimation(View child) {
- if (mIsExpanded && mAnimationsEnabled && !mChildrenChangingPositions.contains(child)) {
+ if (mIsExpanded && mAnimationsEnabled && !mChangePositionInProgress) {
// Generate Animations
mChildrenToAddAnimated.add(child);
mNeedsAnimation = true;
@@ -1428,10 +1429,14 @@ public class NotificationStackScrollLayout extends ViewGroup
*/
public void changeViewPosition(View child, int newIndex) {
if (child != null && child.getParent() == this) {
- mChildrenChangingPositions.add(child);
+ mChangePositionInProgress = true;
removeView(child);
addView(child, newIndex);
- mNeedsAnimation = true;
+ mChangePositionInProgress = false;
+ if (mIsExpanded && mAnimationsEnabled) {
+ mChildrenChangingPositions.add(child);
+ mNeedsAnimation = true;
+ }
}
}