Update notification view to match newer specs

- Use smaller radius for notifications round rect background
- Remove "Notifications" header, and clip children to round rect path
- Flip main notification so that icon shows on the right instead of
  left; footer is also flipped so animation makes sense
- Clean up animations to animate view outline instead of height

Bug: 32410600
Change-Id: I6bd1e1f8395b3703f28c3b0056a89e67672368ab
diff --git a/res/drawable/bg_white_pill_top.xml b/res/drawable/bg_white_pill_top.xml
deleted file mode 100644
index 9988b29..0000000
--- a/res/drawable/bg_white_pill_top.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2017 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
-       android:shape="rectangle">
-    <solid android:color="#FFFFFF" />
-    <corners android:topLeftRadius="@dimen/bg_pill_radius"
-             android:topRightRadius="@dimen/bg_pill_radius" />
-</shape>
\ No newline at end of file
diff --git a/res/drawable/bg_white_pill_bottom.xml b/res/drawable/bg_white_round_rect.xml
similarity index 86%
rename from res/drawable/bg_white_pill_bottom.xml
rename to res/drawable/bg_white_round_rect.xml
index a1ea48c..c7f786f 100644
--- a/res/drawable/bg_white_pill_bottom.xml
+++ b/res/drawable/bg_white_round_rect.xml
@@ -17,6 +17,5 @@
 <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle">
     <solid android:color="#FFFFFF" />
-    <corners android:bottomLeftRadius="@dimen/bg_pill_radius"
-             android:bottomRightRadius="@dimen/bg_pill_radius" />
+    <corners android:radius="@dimen/bg_round_rect_radius" />
 </shape>
\ No newline at end of file
diff --git a/res/layout/notification.xml b/res/layout/notification.xml
index d828c4a..48c7b48 100644
--- a/res/layout/notification.xml
+++ b/res/layout/notification.xml
@@ -20,7 +20,7 @@
     android:layout_width="@dimen/bg_pill_width"
     android:layout_height="wrap_content"
     android:elevation="@dimen/deep_shortcuts_elevation"
-    android:background="@drawable/bg_white_pill">
+    android:background="@drawable/bg_white_round_rect">
 
     <RelativeLayout
         android:layout_width="match_parent"
@@ -28,27 +28,10 @@
         android:orientation="vertical"
         android:clipChildren="false">
 
-        <TextView
-            android:id="@+id/header"
-            android:layout_width="match_parent"
-            android:layout_height="@dimen/notification_footer_collapsed_height"
-            android:gravity="center_vertical"
-            android:textAlignment="center"
-            android:text="@string/notifications_header"
-            android:elevation="@dimen/notification_elevation"
-            android:background="@drawable/bg_white_pill_top" />
-
-        <View
-            android:id="@+id/divider"
-            android:layout_width="match_parent"
-            android:layout_height="@dimen/notification_divider_height"
-            android:layout_below="@id/header" />
-
         <include layout="@layout/notification_main"
             android:id="@+id/main_view"
             android:layout_width="match_parent"
-            android:layout_height="@dimen/bg_pill_height"
-            android:layout_below="@id/divider" />
+            android:layout_height="@dimen/notification_main_height" />
 
         <include layout="@layout/notification_footer"
             android:id="@+id/footer"
diff --git a/res/layout/notification_footer.xml b/res/layout/notification_footer.xml
index ceea24a..c025819 100644
--- a/res/layout/notification_footer.xml
+++ b/res/layout/notification_footer.xml
@@ -20,7 +20,6 @@
     android:layout_height="match_parent"
     android:orientation="vertical"
     xmlns:android="http://schemas.android.com/apk/res/android"
-    android:background="@drawable/bg_white_pill_bottom"
     android:elevation="@dimen/notification_elevation"
     android:clipChildren="false" >
 
@@ -34,6 +33,7 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:orientation="horizontal"
+        android:gravity="end"
         android:padding="@dimen/notification_footer_icon_row_padding"
         android:clipToPadding="false"
         android:clipChildren="false"/>
diff --git a/res/layout/notification_main.xml b/res/layout/notification_main.xml
index 84827f1..d036fe5 100644
--- a/res/layout/notification_main.xml
+++ b/res/layout/notification_main.xml
@@ -21,20 +21,14 @@
     android:layout_height="match_parent"
     android:orientation="horizontal"
     android:focusable="true"
+    android:padding="@dimen/notification_padding"
     android:elevation="@dimen/notification_elevation" >
 
-    <View
-        android:id="@+id/popup_item_icon"
-        android:layout_width="@dimen/notification_icon_size"
-        android:layout_height="@dimen/notification_icon_size"
-        android:layout_marginStart="@dimen/notification_icon_margin_start"
-        android:layout_gravity="center_vertical" />
-
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:orientation="vertical"
-        android:layout_marginStart="@dimen/notification_text_margin_start"
+        android:layout_weight="1"
         android:gravity="center_vertical">
         <TextView
             android:id="@+id/title"
@@ -56,5 +50,12 @@
             android:layout_height="wrap_content" />
     </LinearLayout>
 
+    <View
+        android:id="@+id/popup_item_icon"
+        android:layout_width="@dimen/notification_icon_size"
+        android:layout_height="@dimen/notification_icon_size"
+        android:layout_weight="0"
+        android:layout_gravity="center_vertical" />
+
 </com.android.launcher3.notification.NotificationMainView>
 
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 517bf9f..177e08e 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -175,19 +175,18 @@
 <!-- Icon badges (with notification counts) -->
     <dimen name="badge_size">24dp</dimen>
     <dimen name="badge_text_size">12dp</dimen>
-    <dimen name="badge_small_padding">1dp</dimen>
+    <dimen name="badge_small_padding">0dp</dimen>
     <dimen name="badge_large_padding">3dp</dimen>
     <dimen name="notification_icon_size">28dp</dimen>
     <dimen name="notification_footer_icon_size">24dp</dimen>
-    <!-- (icon_size - secondary_icon_size) / 2 -->
 
 <!-- Notifications -->
+    <dimen name="bg_round_rect_radius">12dp</dimen>
+    <dimen name="notification_padding">12dp</dimen>
+    <!-- (icon_size - footer_icon_size) / 2 -->
     <dimen name="notification_footer_icon_row_padding">2dp</dimen>
-    <dimen name="notification_icon_margin_start">8dp</dimen>
-    <dimen name="notification_text_margin_start">8dp</dimen>
-    <dimen name="notification_footer_height">36dp</dimen>
-    <!-- The height to use when there are no icons in the footer -->
-    <dimen name="notification_footer_collapsed_height">@dimen/bg_pill_radius</dimen>
+    <dimen name="notification_main_height">60dp</dimen>
+    <dimen name="notification_footer_height">@dimen/bg_pill_height</dimen>
     <dimen name="notification_elevation">2dp</dimen>
     <dimen name="notification_divider_height">0.5dp</dimen>
     <dimen name="swipe_helper_falsing_threshold">70dp</dimen>