Fixed bugs in the stack scroller

- A hole could occur when collapsing and expanding in the same touch
- The second card was not correctly resized if the stack was scrolled

Bug: 15996450
Change-Id: Ie779ed5d63b8c55d490c459955bafbc583bfce97
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 4086022..641dea3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
@@ -1800,14 +1800,14 @@
     public void onExpansionStopped() {
         mIsExpansionChanging = false;
         mStackScrollAlgorithm.onExpansionStopped();
+        if (!mIsExpanded) {
+            mOwnScrollY = 0;
+        }
     }
 
     private void setIsExpanded(boolean isExpanded) {
         mIsExpanded = isExpanded;
         mStackScrollAlgorithm.setIsExpanded(isExpanded);
-        if (!isExpanded) {
-            mOwnScrollY = 0;
-        }
     }
 
     @Override