Move spring loaded scale calculation to DeviceProfile.

Fix: 229838395
Test: manual
Change-Id: I6dbbc850e88aaacceb1363e342404b06104f8c10
This commit is contained in:
Pat Manning
2022-04-22 11:29:17 +01:00
parent 3a16087bab
commit a2e1499a2f
3 changed files with 33 additions and 21 deletions

View File

@@ -237,10 +237,8 @@ public class DropTargetBar extends FrameLayout
rightButton.getMeasuredHeight());
} else if (dp.isPhone) {
// Buttons aligned to outer edges of scaled workspace.
float shrunkTop = dp.getWorkspaceSpringLoadShrunkTop();
float shrunkBottom = dp.getWorkspaceSpringLoadShrunkBottom();
float scale =
(shrunkBottom - shrunkTop) / launcher.getWorkspace().getNormalChildHeight();
float scale = dp.getWorkspaceSpringLoadScale();
int workspaceWidth = (int) (launcher.getWorkspace().getNormalChildWidth() * scale);
int start = barCenter - (workspaceWidth / 2);
int end = barCenter + (workspaceWidth / 2);