diff options
-rw-r--r-- | res/values-sw720dp/dimens.xml | 3 | ||||
-rw-r--r-- | res/values/dimens.xml | 4 | ||||
-rw-r--r-- | src/com/android/launcher2/Workspace.java | 14 |
3 files changed, 7 insertions, 14 deletions
diff --git a/res/values-sw720dp/dimens.xml b/res/values-sw720dp/dimens.xml index 7daccd079..4750ae29c 100644 --- a/res/values-sw720dp/dimens.xml +++ b/res/values-sw720dp/dimens.xml @@ -42,9 +42,6 @@ <integer name="apps_customize_maxCellCountY">-1</integer> <dimen name="all_apps_button_vertical_padding">4dip</dimen> - <!-- roughly a status bar (for determining how many rows of icons are in home) --> - <dimen name="status_bar_height">48dip</dimen> - <!-- dimensions for the wallpaper picker wallpaper thumbnail width --> <dimen name="wallpaper_chooser_grid_width">196dp</dimen> <dimen name="wallpaper_chooser_grid_height">140dp</dimen> diff --git a/res/values/dimens.xml b/res/values/dimens.xml index f15d3d89b..fb96c0d9f 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -86,10 +86,6 @@ <!-- Drag padding to add to the bottom of drop targets --> <dimen name="drop_target_drag_padding">14dp</dimen> - <!-- roughly a status bar (for vertically centering the all apps - home icon in landscape) --> - <dimen name="status_bar_height">25dip</dimen> - <!-- Dragging --> <!-- the area at the edge of the screen that makes the workspace go left or right while you're dragging. --> diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index 84494d250..1347511ba 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -273,6 +273,7 @@ public class Workspace extends SmoothPagedView // With workspace, data is available straight from the get-go setDataIsReady(); + mLauncher = (Launcher) context; final Resources res = getResources(); mWorkspaceFadeInAdjacentScreens = res.getBoolean(R.bool.config_workspaceFadeAdjacentScreens); mFadeInAdjacentScreens = false; @@ -291,20 +292,20 @@ public class Workspace extends SmoothPagedView // landscape TypedArray actionBarSizeTypedArray = context.obtainStyledAttributes(new int[] { android.R.attr.actionBarSize }); - DisplayMetrics displayMetrics = res.getDisplayMetrics(); final float actionBarHeight = actionBarSizeTypedArray.getDimension(0, 0f); - final float systemBarHeight = res.getDimension(R.dimen.status_bar_height); - final float smallestScreenDim = res.getConfiguration().smallestScreenWidthDp * - displayMetrics.density; + + Point minDims = new Point(); + Point maxDims = new Point(); + mLauncher.getWindowManager().getDefaultDisplay().getCurrentSizeRange(minDims, maxDims); cellCountX = 1; - while (CellLayout.widthInPortrait(res, cellCountX + 1) <= smallestScreenDim) { + while (CellLayout.widthInPortrait(res, cellCountX + 1) <= minDims.x) { cellCountX++; } cellCountY = 1; while (actionBarHeight + CellLayout.heightInLandscape(res, cellCountY + 1) - <= smallestScreenDim - systemBarHeight) { + <= minDims.y) { cellCountY++; } } @@ -326,7 +327,6 @@ public class Workspace extends SmoothPagedView LauncherModel.updateWorkspaceLayoutCells(cellCountX, cellCountY); setHapticFeedbackEnabled(false); - mLauncher = (Launcher) context; initWorkspace(); // Disable multitouch across the workspace/all apps/customize tray |