diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java index ac41a2bd7b..86bc1b047c 100644 --- a/src/com/android/launcher3/CellLayout.java +++ b/src/com/android/launcher3/CellLayout.java @@ -3230,6 +3230,11 @@ out: for (int i = x; i < x + spanX - 1 && x < xCount; i++) { */ public boolean isLockedToGrid = true; + /** + * Indicates that this item should use the full extents of its parent. + */ + public boolean isFullscreen = false; + /** * Indicates whether this item can be reordered. Always true except in the case of the * the AllApps button. diff --git a/src/com/android/launcher3/ShortcutAndWidgetContainer.java b/src/com/android/launcher3/ShortcutAndWidgetContainer.java index 18b9399d1c..64a87ef071 100644 --- a/src/com/android/launcher3/ShortcutAndWidgetContainer.java +++ b/src/com/android/launcher3/ShortcutAndWidgetContainer.java @@ -92,13 +92,15 @@ public class ShortcutAndWidgetContainer extends ViewGroup { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int count = getChildCount(); + + int widthSpecSize = MeasureSpec.getSize(widthMeasureSpec); + int heightSpecSize = MeasureSpec.getSize(heightMeasureSpec); + setMeasuredDimension(widthSpecSize, heightSpecSize); + for (int i = 0; i < count; i++) { View child = getChildAt(i); measureChild(child); } - int widthSpecSize = MeasureSpec.getSize(widthMeasureSpec); - int heightSpecSize = MeasureSpec.getSize(heightMeasureSpec); - setMeasuredDimension(widthSpecSize, heightSpecSize); } public void setupLp(CellLayout.LayoutParams lp) { @@ -115,8 +117,15 @@ public class ShortcutAndWidgetContainer extends ViewGroup { final int cellWidth = mCellWidth; final int cellHeight = mCellHeight; CellLayout.LayoutParams lp = (CellLayout.LayoutParams) child.getLayoutParams(); - - lp.setup(cellWidth, cellHeight, mWidthGap, mHeightGap, invertLayoutHorizontally(), mCountX); + if (!lp.isFullscreen) { + lp.setup(cellWidth, cellHeight, mWidthGap, mHeightGap, invertLayoutHorizontally(), + mCountX); + } else { + lp.x = 0; + lp.y = 0; + lp.width = getMeasuredWidth(); + lp.height = getMeasuredHeight(); + } int childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(lp.width, MeasureSpec.EXACTLY); int childheightMeasureSpec = MeasureSpec.makeMeasureSpec(lp.height, MeasureSpec.EXACTLY); diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index edf372144c..985538cb25 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -537,6 +537,7 @@ public class Workspace extends SmoothPagedView CellLayout.LayoutParams lp = new CellLayout.LayoutParams(0, 0, spanX, spanY); lp.canReorder = false; + lp.isFullscreen = true; customScreen.addViewToCellLayout(customContent, 0, 0, lp, true);