Initial changes to support a fixed all-apps layout.

- Dynamically update padding and background depending on fixed bounds and searchbar
- Fixes issue with drag layer bg getting clobbered when rotating launcher
- Tapping outside the bounds of all apps should close all apps
- Fixing typo causing widgets to not show in sw720dp devices

Bug: 20127840

Change-Id: I29c3f905bdee940f938ffe054f58434887073092
diff --git a/res/drawable/apps_list_bg.xml b/res/drawable/apps_list_bg.xml
index 64177c1..0e56684 100644
--- a/res/drawable/apps_list_bg.xml
+++ b/res/drawable/apps_list_bg.xml
@@ -14,7 +14,9 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<inset xmlns:android="http://schemas.android.com/apk/res/android"
-       android:drawable="@drawable/apps_list_bg_inset"
-       android:insetLeft="@dimen/apps_container_inset"
-       android:insetRight="@dimen/apps_container_inset" />
\ No newline at end of file
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+       android:shape="rectangle">
+    <solid android:color="#ffffff" />
+    <corners
+        android:radius="2dp" />
+</shape>
\ No newline at end of file
diff --git a/res/drawable/apps_list_search_bg.xml b/res/drawable/apps_list_search_bg.xml
index eda33a9..63c4d55 100644
--- a/res/drawable/apps_list_search_bg.xml
+++ b/res/drawable/apps_list_search_bg.xml
@@ -18,6 +18,6 @@
        android:shape="rectangle">
     <solid android:color="#ffffff" />
     <corners
-        android:topLeftRadius="3dp"
-        android:topRightRadius="3dp" />
+        android:bottomLeftRadius="2dp"
+        android:bottomRightRadius="2dp" />
 </shape>
\ No newline at end of file
diff --git a/res/drawable/apps_reveal_bg.xml b/res/drawable/apps_reveal_bg.xml
index 47c608f..07505a5 100644
--- a/res/drawable/apps_reveal_bg.xml
+++ b/res/drawable/apps_reveal_bg.xml
@@ -14,7 +14,8 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<inset xmlns:android="http://schemas.android.com/apk/res/android"
-       android:drawable="@drawable/apps_reveal_bg_inset"
-       android:insetLeft="@dimen/apps_container_inset"
-       android:insetRight="@dimen/apps_container_inset" />
\ No newline at end of file
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+       android:shape="rectangle">
+    <solid android:color="#ffffff" />
+    <corners android:radius="2dp" />
+</shape>
\ No newline at end of file
diff --git a/res/drawable/apps_reveal_bg_inset.xml b/res/drawable/apps_reveal_bg_inset.xml
deleted file mode 100644
index 61f1c08..0000000
--- a/res/drawable/apps_reveal_bg_inset.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-     Copyright (C) 2015 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:radius="3dp" />
-</shape>
\ No newline at end of file
diff --git a/res/drawable/apps_list_bg_inset.xml b/res/drawable/apps_search_bg.xml
similarity index 90%
rename from res/drawable/apps_list_bg_inset.xml
rename to res/drawable/apps_search_bg.xml
index 5ea7895..405e844 100644
--- a/res/drawable/apps_list_bg_inset.xml
+++ b/res/drawable/apps_search_bg.xml
@@ -18,6 +18,6 @@
        android:shape="rectangle">
     <solid android:color="#ffffff" />
     <corners
-        android:bottomLeftRadius="3dp"
-        android:bottomRightRadius="3dp" />
+        android:topLeftRadius="2dp"
+        android:topRightRadius="2dp" />
 </shape>
\ No newline at end of file
diff --git a/res/layout-sw600dp/apps_view.xml b/res/layout-sw600dp/apps_view.xml
index fba170b..e6e0ec3 100644
--- a/res/layout-sw600dp/apps_view.xml
+++ b/res/layout-sw600dp/apps_view.xml
@@ -19,7 +19,6 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:padding="@dimen/apps_container_inset"
-    android:background="@drawable/apps_customize_bg"
     android:descendantFocusability="afterDescendants">
     <include
         layout="@layout/apps_reveal_view"
diff --git a/res/layout-sw720dp/launcher.xml b/res/layout-sw720dp/launcher.xml
index 8bd827a..a9601af 100644
--- a/res/layout-sw720dp/launcher.xml
+++ b/res/layout-sw720dp/launcher.xml
@@ -67,7 +67,7 @@
             android:layout_gravity="center_horizontal" />
 
         <include layout="@layout/widgets_view"
-            android:id="@+id/widget_view"
+            android:id="@+id/widgets_view"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:visibility="invisible" />
diff --git a/res/layout/apps_list_view.xml b/res/layout/apps_list_view.xml
index 3e42f84..595c46c 100644
--- a/res/layout/apps_list_view.xml
+++ b/res/layout/apps_list_view.xml
@@ -25,8 +25,6 @@
         android:id="@+id/app_search_box"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginLeft="@dimen/apps_container_inset"
-        android:layout_marginRight="@dimen/apps_container_inset"
         android:padding="16dp"
         android:hint="@string/apps_view_search_bar_hint"
         android:maxLines="1"
@@ -37,7 +35,7 @@
         android:textColor="#4c4c4c"
         android:textColorHint="#9c9c9c"
         android:imeOptions="actionDone|flagNoExtractUi"
-        android:background="@drawable/apps_list_search_bg"
+        android:background="@drawable/apps_search_bg"
         android:elevation="4dp" />
     <com.android.launcher3.AppsContainerRecyclerView
         android:id="@+id/apps_list_view"
@@ -48,6 +46,5 @@
         android:paddingBottom="12dp"
         android:clipToPadding="false"
         android:focusable="true"
-        android:descendantFocusability="afterDescendants"
-        android:background="@drawable/apps_list_bg" />
+        android:descendantFocusability="afterDescendants" />
 </LinearLayout>
\ No newline at end of file
diff --git a/res/layout/apps_reveal_view.xml b/res/layout/apps_reveal_view.xml
index bc93359..2951ea4 100644
--- a/res/layout/apps_reveal_view.xml
+++ b/res/layout/apps_reveal_view.xml
@@ -21,5 +21,4 @@
     android:layout_gravity="center"
     android:elevation="15dp"
     android:visibility="invisible"
-    android:background="@drawable/apps_reveal_bg"
     android:focusable="false" />
\ No newline at end of file
diff --git a/res/layout/apps_view.xml b/res/layout/apps_view.xml
index 86d67e1..7f09f77 100644
--- a/res/layout/apps_view.xml
+++ b/res/layout/apps_view.xml
@@ -21,9 +21,6 @@
     android:id="@+id/apps_view"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:paddingTop="@dimen/apps_container_inset"
-    android:paddingBottom="@dimen/apps_container_inset"
-    android:background="@drawable/apps_customize_bg"
     android:descendantFocusability="afterDescendants">
     <include
         layout="@layout/apps_reveal_view"
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 7c99278..101b755 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -50,6 +50,8 @@
     <dimen name="apps_container_width">0dp</dimen>
     <dimen name="apps_container_height">0dp</dimen>
     <dimen name="apps_container_inset">8dp</dimen>
+    <!-- Note: This needs to match the fixed insets for the search box -->
+    <dimen name="apps_container_fixed_bounds_inset">8dp</dimen>
     <dimen name="apps_grid_view_start_margin">52dp</dimen>
     <dimen name="apps_view_row_height">64dp</dimen>
     <dimen name="apps_view_section_text_size">24sp</dimen>