Move spring loaded scale calculation to DeviceProfile.

Fix: 229838395
Test: manual
Change-Id: I6dbbc850e88aaacceb1363e342404b06104f8c10
This commit is contained in:
Pat Manning committed 2022-04-25 18:58:09 +01:00
1 parent 3a16087bab
commit a2e1499a2f
3 files changed
+33 -21

No files matched your search

@@ -52,16 +52,7 @@ public class SpringLoadedState extends LauncherState {
}
float shrunkTop = grid.getWorkspaceSpringLoadShrunkTop();
float shrunkBottom = grid.getWorkspaceSpringLoadShrunkBottom();
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 scale = grid.getWorkspaceSpringLoadScale();
float halfHeight = ws.getHeight() / 2;
float myCenter = ws.getTop() + halfHeight;