[automerger] Fix workspace scale calculation am: 41be2fc783

Change-Id: Iecac06330e2469a6f15309558992fc5f338bfab4
This commit is contained in:
Android Build Merger (Role) committed 2018-05-10 21:00:40 +00:00
commit 71287f6727
1 file changed
+4 -1
@@ -50,8 +50,11 @@ public class OverviewState extends LauncherState {
public float[] getWorkspaceScaleAndTranslation(Launcher launcher) {
RecentsView recentsView = launcher.getOverviewPanel();
Workspace workspace = launcher.getWorkspace();
View workspacePage = workspace.getPageAt(workspace.getCurrentPage());
float workspacePageWidth = workspacePage != null && workspacePage.getWidth() != 0
? workspacePage.getWidth() : launcher.getDeviceProfile().availableWidthPx;
recentsView.getTaskSize(sTempRect);
float scale = (float) sTempRect.width() / workspace.getWidth();
float scale = (float) sTempRect.width() / workspacePageWidth;
float parallaxFactor = 0.4f;
return new float[]{scale, 0, -getDefaultSwipeHeight(launcher) * parallaxFactor};
}