Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef2e9c51 authored by Pat Manning's avatar Pat Manning Committed by Automerger Merge Worker
Browse files

Merge "Scale using workspace width for handheld device on swiping from home to...

Merge "Scale using workspace width for handheld device on swiping from home to overview." into tm-qpr-dev am: 105d72b6 am: 285121bd

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21958125



Change-Id: I0852334fd194b2c5478d1945814731dfb3ba09a8
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 0529dbe4 285121bd
Loading
Loading
Loading
Loading
+10 −2
Original line number Original line Diff line number Diff line
@@ -75,9 +75,17 @@ public class OverviewState extends LauncherState {
    @Override
    @Override
    public ScaleAndTranslation getWorkspaceScaleAndTranslation(Launcher launcher) {
    public ScaleAndTranslation getWorkspaceScaleAndTranslation(Launcher launcher) {
        RecentsView recentsView = launcher.getOverviewPanel();
        RecentsView recentsView = launcher.getOverviewPanel();
        float workspacePageHeight = launcher.getDeviceProfile().getCellLayoutHeight();
        recentsView.getTaskSize(sTempRect);
        recentsView.getTaskSize(sTempRect);
        float scale = (float) sTempRect.height() / workspacePageHeight;
        float scale;
        DeviceProfile deviceProfile = launcher.getDeviceProfile();
        if (deviceProfile.isTwoPanels) {
            // In two panel layout, width does not include both panels or space between them, so
            // use height instead. We do not use height for handheld, as cell layout can be
            // shorter than a task and we want the workspace to scale down to task size.
            scale = (float) sTempRect.height() / deviceProfile.getCellLayoutHeight();
        } else {
            scale = (float) sTempRect.width() / deviceProfile.getCellLayoutWidth();
        }
        float parallaxFactor = 0.5f;
        float parallaxFactor = 0.5f;
        return new ScaleAndTranslation(scale, 0, -getDefaultSwipeHeight(launcher) * parallaxFactor);
        return new ScaleAndTranslation(scale, 0, -getDefaultSwipeHeight(launcher) * parallaxFactor);
    }
    }