Improved ticker & bar animations.

The entire notification area fades out quickly before the
notification ticker appears, and fades back in when the
ticker is totally done.

This change has the side-effect of bringing back nice
animations for the notification icons when they appear by
themselves (at boot and when unlocking the device).

Bug: 3293680
Bug: 3018785
Change-Id: Id99cc20e6849f0f037fc9fba076243d362664478
diff --git a/packages/SystemUI/res/layout-xlarge/status_bar.xml b/packages/SystemUI/res/layout-xlarge/status_bar.xml
index ec57de3..0eaf08e 100644
--- a/packages/SystemUI/res/layout-xlarge/status_bar.xml
+++ b/packages/SystemUI/res/layout-xlarge/status_bar.xml
@@ -31,6 +31,7 @@
             android:id="@+id/bar_contents"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
+            android:animateLayoutChanges="true"
             >
 
             <!-- notification icons & panel access -->
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index 64de588..3201f8b0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -716,10 +716,17 @@
             if (0 == (mDisabled & (StatusBarManager.DISABLE_NOTIFICATION_ICONS
                             | StatusBarManager.DISABLE_NOTIFICATION_TICKER))) {
                 mTicker.add(key, n);
+
+                mNotificationArea.setVisibility(View.GONE);
             }
         }
     }
 
+    // called by TabletTicker when it's done with all queued ticks
+    public void doneTicking() {
+        mNotificationArea.setVisibility(View.VISIBLE);
+    }
+
     public void animateExpand() {
         mHandler.removeMessages(MSG_OPEN_NOTIFICATION_PANEL);
         mHandler.sendEmptyMessage(MSG_OPEN_NOTIFICATION_PANEL);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java
index bc8dedc..32f1e98 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java
@@ -236,6 +236,7 @@
             WindowManagerImpl.getDefault().removeView(mWindow);
             mWindow = null;
             mWindowShouldClose = false;
+            mBar.doneTicking();
         }
     }