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

Commit efc5d812 authored by Sergey Pinkevich's avatar Sergey Pinkevich Committed by Android (Google) Code Review
Browse files

Merge "Select task is broken on display large size" into main

parents 97eee72e 638ee178
Loading
Loading
Loading
Loading
+17 −5
Original line number Diff line number Diff line
@@ -4382,11 +4382,14 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T

    private void updatePivots() {
        if (mOverviewSelectEnabled) {
            if (enableGridOnlyOverview()) {
                getModalTaskSize(mTempRect);
                Rect selectedTaskPosition = getSelectedTaskBounds();

                Utilities.getPivotsForScalingRectToRect(mTempRect, selectedTaskPosition,
                        mTempPointF);
            } else {
                mTempPointF.set(mLastComputedTaskSize.centerX(), mLastComputedTaskSize.bottom);
            }
        } else {
            mTempRect.set(mLastComputedTaskSize);
            // Only update pivot when it is tablet and not in grid yet, so the pivot is correct
@@ -5709,11 +5712,20 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
    }

    private void updateEnabledOverlays() {
        TaskView focusedTaskView = getFocusedTaskView();
        int taskCount = getTaskViewCount();
        for (int i = 0; i < taskCount; i++) {
            TaskView taskView = requireTaskViewAt(i);
            if (taskView == focusedTaskView) {
                continue;
            }
            taskView.setOverlayEnabled(mOverlayEnabled && isTaskViewFullyVisible(taskView));
        }
        // Focus task overlay should be enabled and refreshed at last
        if (focusedTaskView != null) {
            focusedTaskView.setOverlayEnabled(
                    mOverlayEnabled && isTaskViewFullyVisible(focusedTaskView));
        }
    }

    public void setOverlayEnabled(boolean overlayEnabled) {