summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/Workspace.java
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2012-06-21 14:27:18 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-06-21 14:27:18 -0700
commitb21f7cf20ef0d37a934df2622cc1596c13a4a723 (patch)
treed35d1df0ca1865700a1a412de99321ddd1d1787d /src/com/android/launcher2/Workspace.java
parent9470783614c733830ad2402c7630c5b3fdfb2a58 (diff)
parent8bc66c7fe4d8f7ac1715010806f49840194279a5 (diff)
downloadandroid_packages_apps_Trebuchet-b21f7cf20ef0d37a934df2622cc1596c13a4a723.tar.gz
android_packages_apps_Trebuchet-b21f7cf20ef0d37a934df2622cc1596c13a4a723.tar.bz2
android_packages_apps_Trebuchet-b21f7cf20ef0d37a934df2622cc1596c13a4a723.zip
Merge "Use getCurrentSizeRange to determine cell dimensions"
Diffstat (limited to 'src/com/android/launcher2/Workspace.java')
-rw-r--r--src/com/android/launcher2/Workspace.java14
1 files changed, 7 insertions, 7 deletions
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