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

Commit e7383360 authored by Schneider Victor-tulias's avatar Schneider Victor-tulias
Browse files

Fix missing screenshots on rotate from recents view select state

Rotating while in the recents view select state causes all taskview screenshots to disappear. Removing the transition to overview also fixes this, but leaves launcher in an incorrect state.

- Updated API to allow transitioning states without animation.
- Removed the animation to update the state correctly while keeping the ui working.

Fixes: 251067808
Test: rotated back and forth on large and small devices, before and after entering select mode
Change-Id: I5bf89ceb1f6b27cde9f7638f32fee3a78ad85ff6
parent 0bc70442
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -200,13 +200,12 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity, RecentsSta
    }

    @Override
    public void setModalStateEnabled(boolean isModalState) {
        super.setModalStateEnabled(isModalState);
    public void setModalStateEnabled(boolean isModalState, boolean animate) {
        if (isModalState) {
            mActivity.getStateManager().goToState(RecentsState.MODAL_TASK);
            mActivity.getStateManager().goToState(RecentsState.MODAL_TASK, animate);
        } else {
            if (mActivity.isInState(RecentsState.MODAL_TASK)) {
                mActivity.getStateManager().goToState(DEFAULT);
                mActivity.getStateManager().goToState(DEFAULT, animate);
                resetModalVisuals();
            }
        }
+3 −4
Original line number Diff line number Diff line
@@ -162,13 +162,12 @@ public class LauncherRecentsView extends RecentsView<QuickstepLauncher, Launcher
    }

    @Override
    public void setModalStateEnabled(boolean isModalState) {
        super.setModalStateEnabled(isModalState);
    public void setModalStateEnabled(boolean isModalState, boolean animate) {
        if (isModalState) {
            mActivity.getStateManager().goToState(LauncherState.OVERVIEW_MODAL_TASK);
            mActivity.getStateManager().goToState(LauncherState.OVERVIEW_MODAL_TASK, animate);
        } else {
            if (mActivity.isInState(LauncherState.OVERVIEW_MODAL_TASK)) {
                mActivity.getStateManager().goToState(LauncherState.OVERVIEW);
                mActivity.getStateManager().goToState(LauncherState.OVERVIEW, animate);
                resetModalVisuals();
            }
        }
+3 −6
Original line number Diff line number Diff line
@@ -1760,7 +1760,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
    private void onOrientationChanged() {
        // If overview is in modal state when rotate, reset it to overview state without running
        // animation.
        setModalStateEnabled(false);
        setModalStateEnabled(/* isModalState= */ false, /* animate= */ false);
        if (isSplitSelectionActive()) {
            onRotateInSplitSelectionState();
        }
@@ -5198,11 +5198,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
        setInsets(mInsets);
    }

    /**
     * Enables or disables modal state for RecentsView
     * @param isModalState
     */
    public void setModalStateEnabled(boolean isModalState) { }
    /** Enables or disables modal state for RecentsView */
    public abstract void setModalStateEnabled(boolean isModalState, boolean animate);

    public TaskOverlayFactory getTaskOverlayFactory() {
        return mTaskOverlayFactory;