Update Search Suggestions and Results Panel

- fix overdraw use as less backgrounds as possible
- make it look like the Dashboard with padding left and right

See bug: #15384992 Setting Dashboard - padding updates

Change-Id: I30ff33e51bc3c73e888d45f0ce6e16784eb6721c
diff --git a/res/drawable/dashboard_tile_background.xml b/res/drawable/dashboard_tile_background.xml
index 2629cda..105ff18 100644
--- a/res/drawable/dashboard_tile_background.xml
+++ b/res/drawable/dashboard_tile_background.xml
@@ -16,6 +16,6 @@
 
 <ripple xmlns:android="http://schemas.android.com/apk/res/android"
     android:color="?android:attr/colorControlHighlight">
-    <item android:drawable="@android:color/white" />
+    <item android:id="@android:id/mask"
+          android:drawable="@android:color/white" />
 </ripple>
-
diff --git a/res/drawable/search_panel_list_background.xml b/res/drawable/search_panel_list_background.xml
new file mode 100644
index 0000000..b2f2627
--- /dev/null
+++ b/res/drawable/search_panel_list_background.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 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.
+-->
+
+<inset xmlns:android="http://schemas.android.com/apk/res/android"
+        android:insetLeft="@dimen/dashboard_padding_start"
+        android:insetTop="@dimen/dashboard_padding_top"
+        android:insetRight="@dimen/dashboard_padding_end"
+        android:insetBottom="@dimen/dashboard_padding_bottom">
+
+    <shape android:shape="rectangle">
+
+        <solid android:color="@android:color/white" />
+
+    </shape>
+
+</inset>
diff --git a/res/layout/dashboard.xml b/res/layout/dashboard.xml
index 391e3e2..c9be94d 100644
--- a/res/layout/dashboard.xml
+++ b/res/layout/dashboard.xml
@@ -19,8 +19,7 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:scrollbarStyle="outsideOverlay"
-    android:clipToPadding="false"
-    android:background="@color/dashboard_background_color">
+    android:clipToPadding="false">
 
         <LinearLayout
                 android:id="@+id/dashboard_container"
diff --git a/res/layout/search_panel.xml b/res/layout/search_panel.xml
index 5e8d587..64b5c20 100644
--- a/res/layout/search_panel.xml
+++ b/res/layout/search_panel.xml
@@ -17,10 +17,7 @@
 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:id="@+id/dashboard"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:paddingStart="@dimen/search_panel_padding_start"
-        android:paddingEnd="@dimen/search_panel_padding_end"
-        android:background="@color/dashboard_background_color">
+        android:layout_height="match_parent">
 
     <LinearLayout android:layout_width="match_parent"
             android:layout_height="match_parent"
@@ -31,14 +28,20 @@
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_gravity="center"
-                android:orientation="vertical"
-                android:elevation="@dimen/search_panel_elevation">
+                android:orientation="vertical">
 
+            <!-- Padding is included in the background -->
             <ListView android:id="@+id/list_suggestions"
                     android:layout_width="match_parent"
                     android:layout_height="match_parent"
-                    android:background="@android:color/white"
+                    android:paddingStart="@dimen/dashboard_padding_start"
+                    android:paddingEnd="@dimen/dashboard_padding_end"
+                    android:paddingTop="@dimen/dashboard_padding_top"
+                    android:paddingBottom="@dimen/dashboard_padding_bottom"
+                    android:scrollbarStyle="outsideOverlay"
                     android:headerDividersEnabled="false"
+                    android:background="@drawable/search_panel_list_background"
+                    android:elevation="@dimen/search_panel_elevation"
                     />
 
         </LinearLayout>
@@ -50,11 +53,18 @@
                 android:orientation="vertical"
                 android:layout_weight="1">
 
+            <!-- Padding is included in the background -->
             <ListView android:id="@+id/list_results"
                     android:layout_width="match_parent"
                     android:layout_height="match_parent"
-                    android:background="@android:color/white"
+                    android:paddingStart="@dimen/dashboard_padding_start"
+                    android:paddingEnd="@dimen/dashboard_padding_end"
+                    android:paddingTop="@dimen/dashboard_padding_top"
+                    android:paddingBottom="@dimen/dashboard_padding_bottom"
+                    android:scrollbarStyle="outsideOverlay"
                     android:headerDividersEnabled="false"
+                    android:background="@drawable/search_panel_list_background"
+                    android:elevation="@dimen/search_panel_elevation"
                     />
 
         </LinearLayout>
diff --git a/res/layout/settings_main.xml b/res/layout/settings_main.xml
index a06096a..0cc018e 100644
--- a/res/layout/settings_main.xml
+++ b/res/layout/settings_main.xml
@@ -40,7 +40,6 @@
                 android:id="@+id/prefs"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
-                android:background="@android:color/white"
                 />
 
     </LinearLayout>
diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml
index d8d75e2..79529e2 100755
--- a/res/values-land/dimens.xml
+++ b/res/values-land/dimens.xml
@@ -45,8 +45,4 @@
     <!-- Dashboard tile image margin start / end -->
     <dimen name="dashboard_tile_image_margin_start">12dp</dimen>
 
-    <!-- Search Results padding in its container -->
-    <dimen name="search_panel_padding_start">4dp</dimen>
-    <dimen name="search_panel_padding_end">4dp</dimen>
-
 </resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 8906bc5..cb2a9f0 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -141,10 +141,6 @@
     <!-- Search Panel elevation -->
     <dimen name="search_panel_elevation">4dp</dimen>
 
-    <!-- Search Panel padding in its container -->
-    <dimen name="search_panel_padding_start">4dp</dimen>
-    <dimen name="search_panel_padding_end">4dp</dimen>
-
     <!-- Search title (recent / results) padding start -->
     <dimen name="search_title_padding_start">12dp</dimen>