From 15cf5093ce5436f8bf0da7c3875692eeab71796a Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 14 Feb 2012 14:45:18 -0800 Subject: Fixing issue where smallest screen dim was not taking dpi into account. Change-Id: I1efacf693200f490c506050ce36403db224b5846 --- src/com/android/launcher2/Workspace.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/com') diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index 467cec04c..b6f6ac876 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -279,9 +279,11 @@ 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; + final float smallestScreenDim = res.getConfiguration().smallestScreenWidthDp * + displayMetrics.density; cellCountX = 1; while (CellLayout.widthInPortrait(res, cellCountX + 1) <= smallestScreenDim) { -- cgit v1.2.3