Merge "Changing status bar color extraction to use region decoder" into ub-launcher3-master
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index 34d8a83..c65a803 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -315,7 +315,8 @@
             if (!grid.isVerticalBarLayout()) {
                 MarginLayoutParams searchContainerLp =
                         (MarginLayoutParams) mSearchContainer.getLayoutParams();
-                searchContainerLp.height = grid.hotseatBarHeightPx;
+                searchContainerLp.height = mLauncher.getDragLayer().getInsets().top
+                        + grid.hotseatCellHeightPx;
                 mSearchContainer.setLayoutParams(searchContainerLp);
             }
             super.onMeasure(widthMeasureSpec, heightMeasureSpec);
diff --git a/src/com/android/launcher3/allapps/HeaderElevationController.java b/src/com/android/launcher3/allapps/HeaderElevationController.java
index 7941ac5..e79e5c7 100644
--- a/src/com/android/launcher3/allapps/HeaderElevationController.java
+++ b/src/com/android/launcher3/allapps/HeaderElevationController.java
@@ -7,7 +7,6 @@
 import android.graphics.drawable.GradientDrawable;
 import android.os.Build;
 import android.support.v7.widget.RecyclerView;
-import android.util.DisplayMetrics;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.ViewOutlineProvider;
@@ -86,7 +85,7 @@
 
         public ControllerVL(View header) {
             mHeader = header;
-            Resources res = mHeader.getContext().getResources();
+            final Resources res = mHeader.getContext().getResources();
             mMaxElevation = res.getDimension(R.dimen.all_apps_header_max_elevation);
             mScrollToElevation = res.getDimension(R.dimen.all_apps_header_scroll_to_elevation);
 
@@ -98,15 +97,12 @@
                 public void getOutline(View view, Outline outline) {
                     final View parent = (View) mHeader.getParent();
 
-                    DisplayMetrics metrics = new DisplayMetrics();
-                    view.getDisplay().getMetrics(metrics);
-                    int offset = Utilities.pxFromDp(mMaxElevation, metrics);
-
                     final int left = parent.getLeft(); // Use the parent to account for offsets
                     final int top = view.getTop();
                     final int right = left + view.getWidth();
                     final int bottom = view.getBottom();
 
+                    final int offset = Utilities.pxFromDp(mMaxElevation, res.getDisplayMetrics());
                     outline.setRect(left - offset, top - offset, right + offset, bottom);
                 }
             };