Loading quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java +1 −6 Original line number Diff line number Diff line Loading @@ -21,13 +21,11 @@ import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_OVERV import android.content.Context; import android.graphics.Rect; import android.os.SystemProperties; import android.view.View; import com.android.launcher3.DeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.R; import com.android.launcher3.Workspace; import com.android.launcher3.util.Themes; import com.android.quickstep.SysUINavigationMode; import com.android.quickstep.util.LayoutUtils; Loading Loading @@ -66,10 +64,7 @@ public class OverviewState extends LauncherState { @Override public ScaleAndTranslation 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; float workspacePageWidth = launcher.getDeviceProfile().getWorkspaceWidth(); recentsView.getTaskSize(sTempRect); float scale = (float) sTempRect.width() / workspacePageWidth; float parallaxFactor = 0.5f; Loading src/com/android/launcher3/DeviceProfile.java +11 −3 Original line number Diff line number Diff line Loading @@ -813,15 +813,23 @@ public class DeviceProfile { Point padding = getTotalWorkspacePadding(); int numColumns = isTwoPanels ? inv.numColumns * 2 : inv.numColumns; int cellLayoutTotalPadding = isTwoPanels ? 4 * cellLayoutPaddingLeftRightPx : 2 * cellLayoutPaddingLeftRightPx; int screenWidthPx = availableWidthPx - padding.x - cellLayoutTotalPadding; int screenWidthPx = getWorkspaceWidth(padding); result.x = calculateCellWidth(screenWidthPx, cellLayoutBorderSpacePx.x, numColumns); result.y = calculateCellHeight(availableHeightPx - padding.y - cellLayoutBottomPaddingPx, cellLayoutBorderSpacePx.y, inv.numRows); return result; } public int getWorkspaceWidth() { return getWorkspaceWidth(getTotalWorkspacePadding()); } public int getWorkspaceWidth(Point workspacePadding) { int cellLayoutTotalPadding = isTwoPanels ? 4 * cellLayoutPaddingLeftRightPx : 2 * cellLayoutPaddingLeftRightPx; return availableWidthPx - workspacePadding.x - cellLayoutTotalPadding; } public Point getTotalWorkspacePadding() { updateWorkspacePadding(); return new Point(workspacePadding.left + workspacePadding.right, Loading Loading
quickstep/src/com/android/launcher3/uioverrides/states/OverviewState.java +1 −6 Original line number Diff line number Diff line Loading @@ -21,13 +21,11 @@ import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_OVERV import android.content.Context; import android.graphics.Rect; import android.os.SystemProperties; import android.view.View; import com.android.launcher3.DeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.R; import com.android.launcher3.Workspace; import com.android.launcher3.util.Themes; import com.android.quickstep.SysUINavigationMode; import com.android.quickstep.util.LayoutUtils; Loading Loading @@ -66,10 +64,7 @@ public class OverviewState extends LauncherState { @Override public ScaleAndTranslation 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; float workspacePageWidth = launcher.getDeviceProfile().getWorkspaceWidth(); recentsView.getTaskSize(sTempRect); float scale = (float) sTempRect.width() / workspacePageWidth; float parallaxFactor = 0.5f; Loading
src/com/android/launcher3/DeviceProfile.java +11 −3 Original line number Diff line number Diff line Loading @@ -813,15 +813,23 @@ public class DeviceProfile { Point padding = getTotalWorkspacePadding(); int numColumns = isTwoPanels ? inv.numColumns * 2 : inv.numColumns; int cellLayoutTotalPadding = isTwoPanels ? 4 * cellLayoutPaddingLeftRightPx : 2 * cellLayoutPaddingLeftRightPx; int screenWidthPx = availableWidthPx - padding.x - cellLayoutTotalPadding; int screenWidthPx = getWorkspaceWidth(padding); result.x = calculateCellWidth(screenWidthPx, cellLayoutBorderSpacePx.x, numColumns); result.y = calculateCellHeight(availableHeightPx - padding.y - cellLayoutBottomPaddingPx, cellLayoutBorderSpacePx.y, inv.numRows); return result; } public int getWorkspaceWidth() { return getWorkspaceWidth(getTotalWorkspacePadding()); } public int getWorkspaceWidth(Point workspacePadding) { int cellLayoutTotalPadding = isTwoPanels ? 4 * cellLayoutPaddingLeftRightPx : 2 * cellLayoutPaddingLeftRightPx; return availableWidthPx - workspacePadding.x - cellLayoutTotalPadding; } public Point getTotalWorkspacePadding() { updateWorkspacePadding(); return new Point(workspacePadding.left + workspacePadding.right, Loading