Refactored the layout of a notifications

Notifications now consist of ExpandableViews instead of SizeAdaptiveLayouts
to avoid layout passes during the resizing. The StackScrollAlgorithm and its
States are also refactored in order to support the new behaviour. In addition,
the generation of the outline is moved to the notification views instead of
the container which contains them.

Change-Id: I1ac1292a6520f5951610039bfa204c204be9d640
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index 5d75801..82fbb16 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -23,10 +23,12 @@
 import android.view.accessibility.AccessibilityEvent;
 
 import com.android.systemui.R;
+import com.android.systemui.statusbar.ExpandableView;
 import com.android.systemui.statusbar.GestureRecorder;
 import com.android.systemui.statusbar.stack.NotificationStackScrollLayout;
 
-public class NotificationPanelView extends PanelView {
+public class NotificationPanelView extends PanelView implements
+        ExpandableView.OnHeightChangedListener {
     public static final boolean DEBUG_GESTURES = true;
 
     PhoneStatusBar mStatusBar;
@@ -67,6 +69,7 @@
         mKeyguardStatusView = findViewById(R.id.keyguard_status_view);
         mNotificationStackScroller = (NotificationStackScrollLayout)
                 findViewById(R.id.notification_stack_scroller);
+        mNotificationStackScroller.setOnHeightChangedListener(this);
         mNotificationParent = findViewById(R.id.notification_container_parent);
     }
 
@@ -218,4 +221,9 @@
         super.onExpandingFinished();
         mNotificationStackScroller.onExpansionStopped();
     }
+
+    @Override
+    public void onHeightChanged(ExpandableView view) {
+        requestPanelHeightUpdate();
+    }
 }