Loading src/com/android/launcher3/DeviceProfile.java +7 −0 Original line number Diff line number Diff line Loading @@ -928,6 +928,13 @@ public class DeviceProfile { return workspaceSpringLoadShrunkBottom; } /** * Gets the minimum visible amount of the next workspace page when in the spring-loaded state. */ public float getWorkspaceSpringLoadedMinimumNextPageVisible() { return getCellSize().x / 2f; } public int getWorkspaceWidth() { return getWorkspaceWidth(getTotalWorkspacePadding()); } Loading src/com/android/launcher3/states/SpringLoadedState.java +9 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,15 @@ public class SpringLoadedState extends LauncherState { float shrunkTop = grid.getWorkspaceSpringLoadShrunkTop(); float shrunkBottom = grid.getWorkspaceSpringLoadShrunkBottom(); float scale = (shrunkBottom - shrunkTop) / ws.getNormalChildHeight(); float scale = Math.min((shrunkBottom - shrunkTop) / ws.getNormalChildHeight(), 1f); // Reduce scale if next pages would not be visible after scaling the workspace float scaledWorkspaceWidth = ws.getWidth() * scale; float maxAvailableWidth = ws.getWidth() - (2 * grid.getWorkspaceSpringLoadedMinimumNextPageVisible()); if (scaledWorkspaceWidth > maxAvailableWidth) { scale *= maxAvailableWidth / scaledWorkspaceWidth; } float halfHeight = ws.getHeight() / 2; float myCenter = ws.getTop() + halfHeight; Loading Loading
src/com/android/launcher3/DeviceProfile.java +7 −0 Original line number Diff line number Diff line Loading @@ -928,6 +928,13 @@ public class DeviceProfile { return workspaceSpringLoadShrunkBottom; } /** * Gets the minimum visible amount of the next workspace page when in the spring-loaded state. */ public float getWorkspaceSpringLoadedMinimumNextPageVisible() { return getCellSize().x / 2f; } public int getWorkspaceWidth() { return getWorkspaceWidth(getTotalWorkspacePadding()); } Loading
src/com/android/launcher3/states/SpringLoadedState.java +9 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,15 @@ public class SpringLoadedState extends LauncherState { float shrunkTop = grid.getWorkspaceSpringLoadShrunkTop(); float shrunkBottom = grid.getWorkspaceSpringLoadShrunkBottom(); float scale = (shrunkBottom - shrunkTop) / ws.getNormalChildHeight(); float scale = Math.min((shrunkBottom - shrunkTop) / ws.getNormalChildHeight(), 1f); // Reduce scale if next pages would not be visible after scaling the workspace float scaledWorkspaceWidth = ws.getWidth() * scale; float maxAvailableWidth = ws.getWidth() - (2 * grid.getWorkspaceSpringLoadedMinimumNextPageVisible()); if (scaledWorkspaceWidth > maxAvailableWidth) { scale *= maxAvailableWidth / scaledWorkspaceWidth; } float halfHeight = ws.getHeight() / 2; float myCenter = ws.getTop() + halfHeight; Loading