summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2012-04-13 15:08:01 -0700
committerMichael Jurka <mikejurka@google.com>2012-04-13 15:09:00 -0700
commit84f2ce77a6aafa30ff1f8d27edece01c8a89d436 (patch)
tree7f4fca1de4eb854ddc4234000b420f8122256c49
parent3a9fcedbcd235372cd2ab64f825a0b5b3937f59e (diff)
downloadandroid_packages_apps_Trebuchet-84f2ce77a6aafa30ff1f8d27edece01c8a89d436.tar.gz
android_packages_apps_Trebuchet-84f2ce77a6aafa30ff1f8d27edece01c8a89d436.tar.bz2
android_packages_apps_Trebuchet-84f2ce77a6aafa30ff1f8d27edece01c8a89d436.zip
Fix use of deprecated method
-rw-r--r--src/com/android/launcher2/Workspace.java14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index b047eb0f7..d2f050c40 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);
}
/**