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

Commit c609421f authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Maintain fake nav bar position in overview for landscape

NavBar defaults to display when quickswitch ends,
which is always portrait since home is now always
in portrait. We keep the same nav region that the
user used to swipe up to enter recents and reset once
they swipe to home.

Fixes: 156053957
Test: Swipe up from landscape app, then swipe up
from the same nav bar region to go home.

Change-Id: Ia4cf8172850b991aa5e145897622be3b2afa3779
parent 517cec53
Loading
Loading
Loading
Loading
+2 −6
Original line number Original line Diff line number Diff line
@@ -779,12 +779,6 @@ public abstract class BaseSwipeUpHandlerV2<T extends StatefulActivity<?>, Q exte
            }
            }
        }
        }


        if (endTarget == RECENTS || endTarget == HOME) {
            // Since we're now done quickStepping, we want to only listen for touch events
            // for the main orientation's nav bar, instead of multiple
            mDeviceState.enableMultipleRegions(false);
        }

        if (mDeviceState.isOverviewDisabled() && (endTarget == RECENTS || endTarget == LAST_TASK)) {
        if (mDeviceState.isOverviewDisabled() && (endTarget == RECENTS || endTarget == LAST_TASK)) {
            return LAST_TASK;
            return LAST_TASK;
        }
        }
@@ -1242,6 +1236,7 @@ public abstract class BaseSwipeUpHandlerV2<T extends StatefulActivity<?>, Q exte
        }
        }
        ActiveGestureLog.INSTANCE.addLog("finishRecentsAnimation", true);
        ActiveGestureLog.INSTANCE.addLog("finishRecentsAnimation", true);
        doLogGesture(HOME);
        doLogGesture(HOME);
        mDeviceState.enableMultipleRegions(false);
    }
    }


    protected abstract void finishRecentsControllerToHome(Runnable callback);
    protected abstract void finishRecentsControllerToHome(Runnable callback);
@@ -1257,6 +1252,7 @@ public abstract class BaseSwipeUpHandlerV2<T extends StatefulActivity<?>, Q exte


        SystemUiProxy.INSTANCE.get(mContext).onOverviewShown(false, TAG);
        SystemUiProxy.INSTANCE.get(mContext).onOverviewShown(false, TAG);
        doLogGesture(RECENTS);
        doLogGesture(RECENTS);
        mDeviceState.onSwipeUpToOverview(mActivityInterface);
        reset();
        reset();
    }
    }


+5 −0
Original line number Original line Diff line number Diff line
@@ -139,6 +139,11 @@ public final class FallbackActivityInterface extends
                || super.deferStartingActivity(deviceState, ev);
                || super.deferStartingActivity(deviceState, ev);
    }
    }


    @Override
    public void onExitOverview(RecentsAnimationDeviceState deviceState, Runnable exitRunnable) {
        // no-op, fake landscape not supported for 3P
    }

    @Override
    @Override
    public int getContainerType() {
    public int getContainerType() {
        RecentsActivity activity = getCreatedActivity();
        RecentsActivity activity = getCreatedActivity();
+22 −0
Original line number Original line Diff line number Diff line
@@ -44,6 +44,7 @@ import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.appprediction.PredictionUiStateManager;
import com.android.launcher3.appprediction.PredictionUiStateManager;
import com.android.launcher3.statehandlers.DepthController;
import com.android.launcher3.statehandlers.DepthController;
import com.android.launcher3.statehandlers.DepthController.ClampedDepthProperty;
import com.android.launcher3.statehandlers.DepthController.ClampedDepthProperty;
import com.android.launcher3.statemanager.StateManager;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.touch.PagedOrientationHandler;
import com.android.launcher3.touch.PagedOrientationHandler;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.userevent.nano.LauncherLogProto;
@@ -224,6 +225,27 @@ public final class LauncherActivityInterface extends
    }
    }




    @Override
    public void onExitOverview(RecentsAnimationDeviceState deviceState, Runnable exitRunnable) {
        final StateManager<LauncherState> stateManager = getCreatedActivity().getStateManager();
        stateManager.addStateListener(
                new StateManager.StateListener<LauncherState>() {
                    @Override
                    public void onStateTransitionComplete(LauncherState toState) {
                        // Are we going from Recents to Workspace?
                        if (toState == LauncherState.NORMAL) {
                            exitRunnable.run();

                            // reset layout on swipe to home
                            RecentsView recentsView = getCreatedActivity().getOverviewPanel();
                            recentsView.setLayoutRotation(deviceState.getCurrentActiveRotation(),
                                    deviceState.getDisplayRotation());
                            stateManager.removeStateListener(this);
                        }
                    }
                });
    }

    @Override
    @Override
    public Rect getOverviewWindowBounds(Rect homeBounds, RemoteAnimationTargetCompat target) {
    public Rect getOverviewWindowBounds(Rect homeBounds, RemoteAnimationTargetCompat target) {
        return homeBounds;
        return homeBounds;
+0 −1
Original line number Original line Diff line number Diff line
@@ -554,7 +554,6 @@ public class TouchInteractionService extends Service implements PluginListener<O
                || previousGestureState.isRecentsAnimationRunning()
                || previousGestureState.isRecentsAnimationRunning()
                        ? newBaseConsumer(previousGestureState, newGestureState, event)
                        ? newBaseConsumer(previousGestureState, newGestureState, event)
                        : mResetGestureInputConsumer;
                        : mResetGestureInputConsumer;
        // TODO(b/149880412): 2 button landscape mode is wrecked. Fixit!
        if (mDeviceState.isGesturalNavMode()) {
        if (mDeviceState.isGesturalNavMode()) {
            handleOrientationSetup(base);
            handleOrientationSetup(base);
        }
        }
+3 −0
Original line number Original line Diff line number Diff line
@@ -150,6 +150,9 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
        return deviceState.isInDeferredGestureRegion(ev);
        return deviceState.isInDeferredGestureRegion(ev);
    }
    }


    public abstract void onExitOverview(RecentsAnimationDeviceState deviceState,
            Runnable exitRunnable);

    /**
    /**
     * Updates the prediction state to the overview state.
     * Updates the prediction state to the overview state.
     */
     */
Loading