mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 09:56:49 +00:00
Move spring loaded scale calculation to DeviceProfile.
Fix: 229838395 Test: manual Change-Id: I6dbbc850e88aaacceb1363e342404b06104f8c10
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user