diff options
author | Adam Cohen <adamcohen@google.com> | 2013-07-23 15:52:40 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2013-07-23 17:47:54 -0700 |
commit | ec40b2b90c649be3b513af2ba174db56b54b64f6 (patch) | |
tree | a301036354cd36d37d09016a5d5a92c11c52fdae /src/com | |
parent | bffe745b1e195deedc1dcc60f37950b3b0b4c652 (diff) | |
download | android_packages_apps_Trebuchet-ec40b2b90c649be3b513af2ba174db56b54b64f6.tar.gz android_packages_apps_Trebuchet-ec40b2b90c649be3b513af2ba174db56b54b64f6.tar.bz2 android_packages_apps_Trebuchet-ec40b2b90c649be3b513af2ba174db56b54b64f6.zip |
Giving custom content full screen
Change-Id: Icd104fff8a1a315b795a60b812048a6218bf0e5a
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/launcher3/CellLayout.java | 5 | ||||
-rw-r--r-- | src/com/android/launcher3/ShortcutAndWidgetContainer.java | 19 | ||||
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 1 |
3 files changed, 20 insertions, 5 deletions
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java index ac41a2bd7..86bc1b047 100644 --- a/src/com/android/launcher3/CellLayout.java +++ b/src/com/android/launcher3/CellLayout.java @@ -3231,6 +3231,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 18b9399d1..64a87ef07 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 edf372144..985538cb2 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); |