From 84f2ce77a6aafa30ff1f8d27edece01c8a89d436 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Fri, 13 Apr 2012 15:08:01 -0700 Subject: [PATCH] Fix use of deprecated method --- src/com/android/launcher2/Workspace.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index b047eb0f72..d2f050c40c 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -188,8 +188,7 @@ public class Workspace extends SmoothPagedView boolean mUpdateWallpaperOffsetImmediately = false; private Runnable mDelayedResizeRunnable; private Runnable mDelayedSnapToPageRunnable; - private int mDisplayWidth; - private int mDisplayHeight; + private Point mDisplaySize = new Point(); private boolean mIsStaticWallpaper; private int mWallpaperTravelWidth; @@ -404,10 +403,9 @@ public class Workspace extends SmoothPagedView mWallpaperOffset = new WallpaperOffsetInterpolator(); Display display = mLauncher.getWindowManager().getDefaultDisplay(); - mDisplayWidth = display.getWidth(); - mDisplayHeight = display.getHeight(); - mWallpaperTravelWidth = (int) (mDisplayWidth * - wallpaperTravelToScreenWidthRatio(mDisplayWidth, mDisplayHeight)); + display.getSize(mDisplaySize); + mWallpaperTravelWidth = (int) (mDisplaySize.x * + wallpaperTravelToScreenWidthRatio(mDisplaySize.x, mDisplaySize.y)); mMaxDistanceForFolderCreation = (0.6f * res.getDimensionPixelSize(R.dimen.app_icon_size)); mFlingThresholdVelocity = (int) (FLING_THRESHOLD_VELOCITY * mDensity); @@ -955,7 +953,7 @@ public class Workspace extends SmoothPagedView mIsMovingFast = false; return false; } - boolean isLandscape = mDisplayWidth > mDisplayHeight; + boolean isLandscape = mDisplaySize.x > mDisplaySize.y; long currentTime = System.currentTimeMillis(); long timeSinceLastUpdate = currentTime - mLastWallpaperOffsetUpdateTime; @@ -2954,7 +2952,7 @@ public class Workspace extends SmoothPagedView public void getHitRect(Rect outRect) { // We want the workspace to have the whole area of the display (it will find the correct // cell layout to drop to in the existing drag/drop logic. - outRect.set(0, 0, mDisplayWidth, mDisplayHeight); + outRect.set(0, 0, mDisplaySize.x, mDisplaySize.y); } /**