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

Commit 690645b6 authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Remove old split screen overview related code

Bug: 233006032
Change-Id: I294dcde586da135af3bb33400e65d5f47edca3d8
parent dde2536a
Loading
Loading
Loading
Loading
+18 −38
Original line number Diff line number Diff line
@@ -56,11 +56,9 @@ import com.android.launcher3.taskbar.TaskbarUIController;
import com.android.launcher3.touch.PagedOrientationHandler;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.DisplayController.NavigationMode;
import com.android.launcher3.util.WindowBounds;
import com.android.launcher3.views.ScrimView;
import com.android.quickstep.util.ActivityInitListener;
import com.android.quickstep.util.AnimatorControllerWithResistance;
import com.android.quickstep.util.SplitScreenBounds;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.recents.model.ThumbnailData;
@@ -258,7 +256,7 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T

    private void calculateTaskSizeInternal(Context context, DeviceProfile dp,
            Rect potentialTaskRect, float maxScale, int gravity, Rect outRect) {
        PointF taskDimension = getTaskDimension(context, dp);
        PointF taskDimension = getTaskDimension(dp);

        float scale = Math.min(
                potentialTaskRect.width() / taskDimension.x,
@@ -270,33 +268,16 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
        Gravity.apply(gravity, outWidth, outHeight, potentialTaskRect, outRect);
    }

    private static PointF getTaskDimension(Context context, DeviceProfile dp) {
    private static PointF getTaskDimension(DeviceProfile dp) {
        PointF dimension = new PointF();
        getTaskDimension(context, dp, dimension);
        getTaskDimension(dp, dimension);
        return dimension;
    }

    /**
     * Gets the dimension of the task in the current system state.
     */
    public static void getTaskDimension(Context context, DeviceProfile dp, PointF out) {
        if (dp.isMultiWindowMode) {
            WindowBounds bounds = SplitScreenBounds.INSTANCE.getSecondaryWindowBounds(context);
            out.x = bounds.availableSize.x;
            out.y = bounds.availableSize.y;
            if (!TaskView.clipLeft(dp)) {
                out.x += bounds.insets.left;
            }
            if (!TaskView.clipRight(dp)) {
                out.x += bounds.insets.right;
            }
            if (!TaskView.clipTop(dp)) {
                out.y += bounds.insets.top;
            }
            if (!TaskView.clipBottom(dp)) {
                out.y += bounds.insets.bottom;
            }
        } else {
    public static void getTaskDimension(DeviceProfile dp, PointF out) {
        out.x = dp.widthPx;
        out.y = dp.heightPx;
        if (TaskView.clipLeft(dp)) {
@@ -312,7 +293,6 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
            out.y -= Math.max(dp.getInsets().bottom, dp.taskbarSize);
        }
    }
    }

    /**
     * Calculates the overview grid size for the provided device configuration.
@@ -341,7 +321,7 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
                (taskRect.height() + dp.overviewTaskThumbnailTopMarginPx - dp.overviewRowSpacing)
                        / 2f;

        PointF taskDimension = getTaskDimension(context, dp);
        PointF taskDimension = getTaskDimension(dp);
        float scale = (rowHeight - dp.overviewTaskThumbnailTopMarginPx) / taskDimension.y;
        int outWidth = Math.round(scale * taskDimension.x);
        int outHeight = Math.round(scale * taskDimension.y);
+1 −7
Original line number Diff line number Diff line
@@ -416,7 +416,7 @@ public class RecentsOrientedState implements
            fullHeight -= insets.bottom;
        }

        getTaskDimension(mContext, dp, outPivot);
        getTaskDimension(dp, outPivot);
        float scale = Math.min(outPivot.x / taskView.width(), outPivot.y / taskView.height());
        // We also scale the preview as part of fullScreenParams, so account for that as well.
        if (fullWidth > 0) {
@@ -425,12 +425,6 @@ public class RecentsOrientedState implements

        if (scale == 1) {
            outPivot.set(fullWidth / 2, fullHeight / 2);
        } else if (dp.isMultiWindowMode) {
            float denominator = 1 / (scale - 1);
            // Ensure that the task aligns to right bottom for the root view
            float y = (scale * taskView.bottom - fullHeight) * denominator;
            float x = (scale * taskView.right - fullWidth) * denominator;
            outPivot.set(x, y);
        } else {
            float factor = scale / (scale - 1);
            outPivot.set(taskView.left * factor, taskView.top * factor);
+8 −20
Original line number Diff line number Diff line
@@ -451,9 +451,8 @@ public class TaskThumbnailView extends View {

            // Landscape vs portrait change.
            // Note: Disable rotation in grid layout.
            boolean windowingModeSupportsRotation = !dp.isMultiWindowMode
                    && thumbnailData.windowingMode == WINDOWING_MODE_FULLSCREEN
                    && !dp.isTablet;
            boolean windowingModeSupportsRotation =
                    thumbnailData.windowingMode == WINDOWING_MODE_FULLSCREEN && !dp.isTablet;
            isOrientationDifferent = isOrientationChange(deltaRotate)
                    && windowingModeSupportsRotation;
            if (canvasWidth == 0 || canvasHeight == 0 || scale == 0) {
@@ -562,13 +561,8 @@ public class TaskThumbnailView extends View {
            Rect splitScreenInsets = dp.getInsets();
            if (!isRotated) {
                // No Rotation
                if (dp.isMultiWindowMode) {
                    mClippedInsets.offsetTo(splitScreenInsets.left * scale,
                            splitScreenInsets.top * scale);
                } else {
                mClippedInsets.offsetTo(thumbnailClipHint.left * scale,
                        thumbnailClipHint.top * scale);
                }
                mMatrix.setTranslate(
                        -thumbnailClipHint.left * scale,
                        -thumbnailClipHint.top * scale);
@@ -587,16 +581,10 @@ public class TaskThumbnailView extends View {
            }
            mClippedInsets.left *= thumbnailScale;
            mClippedInsets.top *= thumbnailScale;

            if (dp.isMultiWindowMode) {
                mClippedInsets.right = splitScreenInsets.right * scale * thumbnailScale;
                mClippedInsets.bottom = splitScreenInsets.bottom * scale * thumbnailScale;
            } else {
            mClippedInsets.right = Math.max(0,
                    widthWithInsets - mClippedInsets.left - canvasWidth);
            mClippedInsets.bottom = Math.max(0,
                    heightWithInsets - mClippedInsets.top - canvasHeight);
            }

            mMatrix.postScale(thumbnailScale, thumbnailScale);
            mIsOrientationChanged = isOrientationDifferent;
+1 −2
Original line number Diff line number Diff line
@@ -1584,10 +1584,9 @@ public class TaskView extends FrameLayout implements Reusable {
            }
            mCurrentDrawnInsets.set(currentInsetsLeft, insets.top * fullscreenProgress,
                    currentInsetsRight, insetsBottom * fullscreenProgress);
            float fullscreenCornerRadius = dp.isMultiWindowMode ? 0 : mWindowCornerRadius;

            mCurrentDrawnCornerRadius =
                    Utilities.mapRange(fullscreenProgress, mCornerRadius, fullscreenCornerRadius)
                    Utilities.mapRange(fullscreenProgress, mCornerRadius, mWindowCornerRadius)
                            / parentScale / taskViewScale;

            // We scaled the thumbnail to fit the content (excluding insets) within task view width.