Merge "Setting content bounds in onMeasure as it uses measuredWidth, which might not be available during onCreate" into ub-launcher3-burnaby-polish

am: 5df98da8fd

* commit '5df98da8fd2c1997bd6c09a4772f018730345090':
  Setting content bounds in onMeasure as it uses measuredWidth, which might not be available during onCreate
This commit is contained in:
Sunny Goyal
2016-02-17 02:03:05 +00:00
committed by android-build-merger
3 changed files with 9 additions and 7 deletions

View File

@@ -138,6 +138,9 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
private final RecyclerView.LayoutManager mLayoutManager;
private final RecyclerView.ItemDecoration mItemDecoration;
// The computed bounds of the container
private final Rect mContentBounds = new Rect();
private AllAppsRecyclerView mAppsRecyclerView;
private AllAppsSearchBarController mSearchBarController;
@@ -318,6 +321,10 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
mContentBounds.set(mContentPadding.left, mContentPadding.top,
MeasureSpec.getSize(widthMeasureSpec) - mContentPadding.right,
MeasureSpec.getSize(heightMeasureSpec) - mContentPadding.bottom);
// Update the number of items in the grid before we measure the view
// TODO: mSectionNamesMargin is currently 0, but also account for it,
// if it's enabled in the future.