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

Commit fb624f85 authored by Vinit Nayak's avatar Vinit Nayak Committed by Android (Google) Code Review
Browse files

Merge "Hide overview and app icon split option when appropriate" into sc-v2-dev

parents 8bcbb662 0b73d101
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -107,6 +107,13 @@ public class TaskOverlayFactory implements ResourceBasedOverride {

    public static void addSplitOptions(List<SystemShortcut> outShortcuts,
            BaseDraggingActivity activity, TaskView taskView, DeviceProfile deviceProfile) {
        int[] taskViewTaskIds = taskView.getTaskIds();
        boolean alreadyHasMultipleTasks = taskViewTaskIds[0] != -1 &&
                taskViewTaskIds[1] != -1;
        if (alreadyHasMultipleTasks) {
            return;
        }

        PagedOrientationHandler orientationHandler =
                taskView.getRecentsView().getPagedOrientationHandler();
        List<SplitPositionOption> positions =
+0 −1
Original line number Diff line number Diff line
@@ -223,7 +223,6 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
        mDp = dp;
        updateVerticalMargin(SysUINavigationMode.getMode(getContext()));
        requestLayout();
        setSplitButtonVisible(mDp.isTablet);
    }

    public void setSplitButtonVisible(boolean visible) {
+16 −3
Original line number Diff line number Diff line
@@ -1506,7 +1506,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
        mActionsView.setDp(dp);
        mOrientationState.setDeviceProfile(dp);

        // Update RecentsView adn TaskView's DeviceProfile dependent layout.
        // Update RecentsView and TaskView's DeviceProfile dependent layout.
        updateOrientationHandler();
    }

@@ -2599,7 +2599,6 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
        mFirstFloatingTaskView.setAlpha(1);
        mFirstFloatingTaskView.addAnimation(anim, startingTaskRect,
                mTempRect, mSplitHiddenTaskView, true /*fadeWithThumbnail*/);
        anim.addEndListener(aBoolean -> mActionsView.setSplitButtonVisible(false));
    }

    /**
@@ -2939,6 +2938,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
                        dispatchScrollChanged();
                    }
                }
                updateFocusedSplitButtonVisibility();
                onDismissAnimationEnds();
                mPendingAnimation = null;
            }
@@ -2946,6 +2946,19 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
        return anim;
    }

    /**
     * Shows split button if
     * * We're in large screen
     * * We're not already in split
     * * There are at least 2 tasks to invoke split
     */
    private void updateFocusedSplitButtonVisibility() {
        mActionsView.setSplitButtonVisible(mActivity.getDeviceProfile().isTablet &&
                !(getRunningTaskView() instanceof GroupedTaskView) &&
                getTaskViewCount() > 1
        );
    }

    /**
     * Returns all the tasks in the top row, without the focused task
     */
@@ -3751,7 +3764,6 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
            mSecondSplitHiddenTaskView.setVisibility(VISIBLE);
            mSecondSplitHiddenTaskView = null;
        }
        mActionsView.setSplitButtonVisible(true);
    }

    private void updateDeadZoneRects() {
@@ -3966,6 +3978,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
    @Override
    protected void notifyPageSwitchListener(int prevPage) {
        super.notifyPageSwitchListener(prevPage);
        updateFocusedSplitButtonVisibility();
        loadVisibleTaskData(TaskView.FLAG_UPDATE_ALL);
        updateEnabledOverlays();
    }