Update the notification templates

Most of the notification templates have been updated.
Some cases like media notifications don't yet work well
but will be fixed in a later CL.

Bug: 25376106
Change-Id: I26c366e58ebba3852cea20de6fca311bd302bb24
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java
index 5aedaf1..17d9856 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationContentView.java
@@ -77,7 +77,9 @@
     private boolean mIsHeadsUp;
     private boolean mShowingLegacyBackground;
     private boolean mIsChildInGroup;
+    private ExpandableNotificationRow mContainingNotification;
     private StatusBarNotification mStatusBarNotification;
+    private NotificationGroupManager mGroupManager;
 
     private final ViewTreeObserver.OnPreDrawListener mEnableAnimationPredrawListener
             = new ViewTreeObserver.OnPreDrawListener() {
@@ -96,7 +98,17 @@
                     mRoundRectRadius);
         }
     };
-    private NotificationGroupManager mGroupManager;
+    private OnClickListener mExpandClickListener = new OnClickListener() {
+        @Override
+        public void onClick(View v) {
+            if (mGroupManager.isSummaryOfGroup(mStatusBarNotification)) {
+                mGroupManager.toggleGroupExpansion(mStatusBarNotification);
+            } else {
+                mContainingNotification.setUserExpanded(!mContainingNotification.isExpanded());
+                mContainingNotification.notifyHeightChanged(true);
+            }
+        }
+    };
 
     public NotificationContentView(Context context, AttributeSet attrs) {
         super(context, attrs);
@@ -488,6 +500,10 @@
         updateSingleLineView();
     }
 
+    public void setContainingNotification(ExpandableNotificationRow notification) {
+        mContainingNotification = notification;
+    }
+
     public void setStatusBarNotification(StatusBarNotification statusBarNotification) {
         mStatusBarNotification = statusBarNotification;
         updateSingleLineView();
@@ -515,4 +531,19 @@
     public void setGroupManager(NotificationGroupManager groupManager) {
         mGroupManager = groupManager;
     }
+
+    public void updateExpandButtons() {
+        if (mExpandedChild != null) {
+            mExpandedWrapper.updateExpandability(mContainingNotification.isExpandable(),
+                    mExpandClickListener);
+        }
+        if (mContractedChild != null) {
+            mContractedWrapper.updateExpandability(mContainingNotification.isExpandable(),
+                    mExpandClickListener);
+        }
+        if (mHeadsUpChild != null) {
+            mHeadsUpWrapper.updateExpandability(mContainingNotification.isExpandable(),
+                    mExpandClickListener);
+        }
+    }
 }