From 5f8afe6280eae34620067696173e71943e1a30a3 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 12 Aug 2013 16:19:28 -0700 Subject: Initial Changes for Dynamic Grid Change-Id: I9e6f1e5167791cf8dc140778dfa447f86424e9bf --- src/com/android/launcher3/AppsCustomizePagedView.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/com/android/launcher3/AppsCustomizePagedView.java') diff --git a/src/com/android/launcher3/AppsCustomizePagedView.java b/src/com/android/launcher3/AppsCustomizePagedView.java index dafa9b490..245d7eaf9 100644 --- a/src/com/android/launcher3/AppsCustomizePagedView.java +++ b/src/com/android/launcher3/AppsCustomizePagedView.java @@ -360,12 +360,6 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen Configuration.ORIENTATION_LANDSCAPE; int maxCellCountX = Integer.MAX_VALUE; int maxCellCountY = Integer.MAX_VALUE; - if (LauncherAppState.getInstance().isScreenLarge()) { - maxCellCountX = (isLandscape ? LauncherModel.getCellCountX() : - LauncherModel.getCellCountY()); - maxCellCountY = (isLandscape ? LauncherModel.getCellCountY() : - LauncherModel.getCellCountX()); - } if (mMaxAppCellCountX > -1) { maxCellCountX = Math.min(maxCellCountX, mMaxAppCellCountX); } @@ -1162,7 +1156,9 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen // Note: We force a measure here to get around the fact that when we do layout calculations // immediately after syncing, we don't have a proper width. - int widthSpec = MeasureSpec.makeMeasureSpec(getMeasuredWidth(), MeasureSpec.AT_MOST); + int workspaceWidth = mLauncher.getWorkspace().getMeasuredWidth(); + int widthSpec = MeasureSpec.makeMeasureSpec(Math.min(getMeasuredWidth(), workspaceWidth), + MeasureSpec.AT_MOST); int heightSpec = MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.AT_MOST); layout.setMinimumWidth(getPageContentWidth()); layout.measure(widthSpec, heightSpec); -- cgit v1.2.3