mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 08:16:49 +00:00
Setting content bounds in onMeasure as it uses measuredWidth, which might
not be available during onCreate Also fixing the calculation of allApps column could, which was counting an additional icon gap Bug: 27173894 Change-Id: I8be8cccc76d7e7d945cf9383567a3026228b6c86
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user