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

Commit 62572c04 authored by Alex Chau's avatar Alex Chau
Browse files

Revert "Move BaseActivityInterface task size methods to DevicePr..."

Revert "Move BaseActivityInterface task size methods to DevicePr..."

Revert submission 19279487-baseactivityinterface

Reason for revert: As per discussion in ag/19341332, make sure DeviceProfile can properly react to inset changes before moving task size calculations there
Reverted Changes:
I30324d34c:Move BaseActivityInterface task size methods to De...
Ia9c1d0387:Move BaseActivityInterface task size methods to De...

Bug: 238593212
Change-Id: I0d40fdd4a5d4468494e30cef32a284479ddd2feb
parent 4e73e5e3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -337,7 +337,7 @@ public abstract class BaseQuickstepLauncher extends Launcher {
                new SplitSelectStateController(this, mHandler, getStateManager(),
                        getDepthController());
        overviewPanel.init(mActionsView, controller);
        mActionsView.updateDimension(getDeviceProfile());
        mActionsView.updateDimension(getDeviceProfile(), overviewPanel.getLastComputedTaskSize());
        mActionsView.updateVerticalMargin(DisplayController.getNavigationMode(this));

        mAppTransitionManager = new QuickstepTransitionManager(this);
+1 −1
Original line number Diff line number Diff line
@@ -839,6 +839,6 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
        pw.println(String.format(
                "%s\tmBindInProgress=%b", prefix, mBindingItems));
        mControllers.dumpLogs(prefix + "\t", pw);
        mDeviceProfile.dump(this, prefix, pw);
        mDeviceProfile.dump(prefix, pw);
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -50,7 +50,8 @@ public class BackgroundAppState extends OverviewState {
            return super.getVerticalProgress(launcher);
        }
        RecentsView recentsView = launcher.getOverviewPanel();
        int transitionLength = LayoutUtils.getShelfTrackingDistance(launcher.getDeviceProfile(),
        int transitionLength = LayoutUtils.getShelfTrackingDistance(launcher,
                launcher.getDeviceProfile(),
                recentsView.getPagedOrientationHandler());
        AllAppsTransitionController controller = launcher.getAllAppsController();
        float scrollRange = Math.max(controller.getShiftRange(), 1);
+10 −1
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.launcher3.uioverrides.states;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_OVERVIEW;

import android.content.Context;
import android.graphics.Point;
import android.graphics.Rect;

import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.Launcher;
@@ -69,6 +71,13 @@ public class OverviewModalTaskState extends OverviewState {
    }

    public static float[] getOverviewScaleAndOffsetForModalState(BaseDraggingActivity activity) {
        return new float[] {activity.getDeviceProfile().overviewModalTaskScale, NO_OFFSET};
        Point taskSize = activity.<RecentsView>getOverviewPanel().getSelectedTaskSize();
        Rect modalTaskSize = new Rect();
        activity.<RecentsView>getOverviewPanel().getModalTaskSize(modalTaskSize);

        float scale = Math.min((float) modalTaskSize.height() / taskSize.y,
                (float) modalTaskSize.width() / taskSize.x);

        return new float[] {scale, NO_OFFSET};
    }
}
+5 −2
Original line number Diff line number Diff line
@@ -65,9 +65,12 @@ public class OverviewState extends LauncherState {

    @Override
    public ScaleAndTranslation getWorkspaceScaleAndTranslation(Launcher launcher) {
        RecentsView recentsView = launcher.getOverviewPanel();
        float workspacePageHeight = launcher.getDeviceProfile().getCellLayoutHeight();
        recentsView.getTaskSize(sTempRect);
        float scale = (float) sTempRect.height() / workspacePageHeight;
        float parallaxFactor = 0.5f;
        return new ScaleAndTranslation(launcher.getDeviceProfile().overviewTaskWorkspaceScale, 0,
                -getDefaultSwipeHeight(launcher) * parallaxFactor);
        return new ScaleAndTranslation(scale, 0, -getDefaultSwipeHeight(launcher) * parallaxFactor);
    }

    @Override
Loading