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
This commit is contained in:
Winson Chung
2015-06-04 17:18:17 -07:00
parent e89cf793ab
commit ef7f874a88
29 changed files with 1087 additions and 1064 deletions

View File

@@ -89,9 +89,7 @@ public class BaseRecyclerView extends RecyclerView
private int mLastY;
private int mScrollbarWidth;
private int mScrollbarInset;
private Rect mBackgroundPadding = new Rect();
protected Rect mBackgroundPadding = new Rect();
public BaseRecyclerView(Context context) {
this(context, null);
@@ -230,6 +228,10 @@ public class BaseRecyclerView extends RecyclerView
return false;
}
public void updateBackgroundPadding(Rect padding) {
mBackgroundPadding.set(padding);
}
@Override
protected void dispatchDraw(Canvas canvas) {
super.dispatchDraw(canvas);
@@ -340,9 +342,10 @@ public class BaseRecyclerView extends RecyclerView
// Calculate the position for the fast scroller popup
Rect bgBounds = mFastScrollerBg.getBounds();
if (Utilities.isRtl(getResources())) {
x = mBackgroundPadding.left + getScrollBarSize();
x = mBackgroundPadding.left + (2 * getScrollbarWidth());
} else {
x = getWidth() - getPaddingRight() - getScrollBarSize() - bgBounds.width();
x = getWidth() - mBackgroundPadding.right - (2 * getScrollbarWidth()) -
bgBounds.width();
}
y = mLastY - (int) (FAST_SCROLL_OVERLAY_Y_OFFSET_FACTOR * bgBounds.height());
y = Math.max(getPaddingTop(), Math.min(y, getHeight() - getPaddingBottom() -