Making the page spacing fixed in spring loaded mode. (Bug 6478409)

Change-Id: I3577a1beecacb82528f0fde9439a8366a709b29c
This commit is contained in:
Winson Chung
2012-05-11 16:27:49 -07:00
parent 0e56cc9fd6
commit 8aad610dc5
3 changed files with 22 additions and 7 deletions
+5
View File
@@ -199,6 +199,7 @@ public class Workspace extends SmoothPagedView
private Point mDisplaySize = new Point();
private boolean mIsStaticWallpaper;
private int mWallpaperTravelWidth;
private int mSpringLoadedPageSpacing;
// Variables relating to the creation of user folders by hovering shortcuts over shortcuts
private static final int FOLDER_CREATION_TIMEOUT = 0;
@@ -322,6 +323,8 @@ public class Workspace extends SmoothPagedView
mSpringLoadedShrinkFactor =
res.getInteger(R.integer.config_workspaceSpringLoadShrinkPercentage) / 100.0f;
mSpringLoadedPageSpacing =
res.getDimensionPixelSize(R.dimen.workspace_spring_loaded_page_spacing);
// if the value is manually specified, use that instead
cellCountX = a.getInt(R.styleable.Workspace_cellCountX, cellCountX);
@@ -1536,6 +1539,7 @@ public class Workspace extends SmoothPagedView
if (state != State.NORMAL) {
finalScaleFactor = mSpringLoadedShrinkFactor - (stateIsSmall ? 0.1f : 0);
setPageSpacing(mSpringLoadedPageSpacing);
if (oldStateIsNormal && stateIsSmall) {
zoomIn = false;
setLayoutScale(finalScaleFactor);
@@ -1545,6 +1549,7 @@ public class Workspace extends SmoothPagedView
setLayoutScale(finalScaleFactor);
}
} else {
setPageSpacing(PagedView.AUTOMATIC_PAGE_SPACING);
setLayoutScale(1.0f);
}