Refactoring all apps search to support external search bar.

- Adding support for an external search bar that can be used
  to search a container view.  This adds a new interface
  AllAppsSearchController which manages the external search
  bar.  Each controller will have its own search implementation
  which means that we no longer need a common AppSearchManager
  interface.
- Removing elevation controller as we no longer have a builtin
  search bar in all apps
- Refactoring container view insets so that they behave
  the same in all containers.
- Refactoring apps view to ensure that we only update the number
  of columns with the available width
- Cleaning up LauncherCallbacks interface

Bug: 20127840
Bug: 21494973

Change-Id: I710b8e18196961d77d8a29f0c345531d480936fe
diff --git a/res/layout/all_apps.xml b/res/layout/all_apps.xml
index b907c34..1bf54ee 100644
--- a/res/layout/all_apps.xml
+++ b/res/layout/all_apps.xml
@@ -21,15 +21,37 @@
     android:id="@+id/apps_view"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:descendantFocusability="afterDescendants">
-    <include
-        layout="@layout/all_apps_reveal"
+    android:orientation="vertical">
+
+    <!-- Both android:focusable and android:focusableInTouchMode are needed for
+         the view to get focus change events. -->
+    <FrameLayout
+        android:id="@+id/search_box_container"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_gravity="center" />
-    <include
-        layout="@layout/all_apps_container"
+        android:layout_height="wrap_content"
+        android:focusable="true"
+        android:focusableInTouchMode="true"
+        android:visibility="gone" />
+
+    <FrameLayout
+        android:id="@+id/content"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_gravity="center" />
+        android:layout_height="0dp"
+        android:layout_weight="1">
+        <FrameLayout
+            android:id="@+id/all_apps_reveal"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_gravity="center"
+            android:focusable="false"
+            android:elevation="2dp"
+            android:visibility="invisible" />
+        <include
+            layout="@layout/all_apps_container"
+            android:id="@+id/all_apps_container"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_gravity="center"
+            android:visibility="gone" />
+    </FrameLayout>
 </com.android.launcher3.allapps.AllAppsContainerView>
\ No newline at end of file