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

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

Set overview orientation for all nav modes

3 Button overview orientation wasn't
getting set, but working because of the sensor.
Now we set orientation when entering overview,
and reset to rotation 0 when exiting overview.
Also fix related bug in RecentsOriented state
where we weren't updating the current sensor
rotation with foreground app orientation.

Fixes: 157069195
Change-Id: Ide1b7dbeb68aeaf6a3c45f7260595f69f4813d94
parent 4dfcbec5
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -53,14 +53,17 @@ final class AppToOverviewAnimationProvider<T extends StatefulActivity<?>> extend
    private final BaseActivityInterface<?, T> mActivityInterface;
    // The id of the currently running task that is transitioning to overview.
    private final int mTargetTaskId;
    private final RecentsAnimationDeviceState mDeviceState;

    private T mActivity;
    private RecentsView mRecentsView;

    AppToOverviewAnimationProvider(
            BaseActivityInterface<?, T> activityInterface, int targetTaskId) {
            BaseActivityInterface<?, T> activityInterface, int targetTaskId,
            RecentsAnimationDeviceState deviceState) {
        mActivityInterface = activityInterface;
        mTargetTaskId = targetTaskId;
        mDeviceState = deviceState;
    }

    /**
@@ -73,6 +76,7 @@ final class AppToOverviewAnimationProvider<T extends StatefulActivity<?>> extend
        activity.<RecentsView>getOverviewPanel().showCurrentTask(mTargetTaskId);
        AbstractFloatingView.closeAllOpenViews(activity, wasVisible);
        BaseActivityInterface.AnimationFactory factory = mActivityInterface.prepareRecentsUI(
                mDeviceState,
                wasVisible, (controller) -> {
                    controller.dispatchOnStart();
                    controller.getAnimationPlayer().end();
+0 −3
Original line number Diff line number Diff line
@@ -300,9 +300,6 @@ public abstract class BaseSwipeUpHandler<T extends StatefulActivity<?>, Q extend
            if (TestProtocol.sDebugTracing) {
                Log.d(TestProtocol.PAUSE_NOT_DETECTED, "BaseSwipeUpHandler.2");
            }
            ((RecentsView) createdActivity.getOverviewPanel())
                    .setLayoutRotation(mDeviceState.getCurrentActiveRotation(),
                            mDeviceState.getDisplayRotation());
            initTransitionEndpoints(InvariantDeviceProfile.INSTANCE.get(mContext)
                .getDeviceProfile(mContext));
        }
+1 −1
Original line number Diff line number Diff line
@@ -331,7 +331,7 @@ public abstract class BaseSwipeUpHandlerV2<T extends StatefulActivity<?>, Q exte
        // as that will set the state as BACKGROUND_APP, overriding the animation to NORMAL.
        if (mGestureState.getEndTarget() != HOME) {
            Runnable initAnimFactory = () -> {
                mAnimationFactory = mActivityInterface.prepareRecentsUI(
                mAnimationFactory = mActivityInterface.prepareRecentsUI(mDeviceState,
                        mWasLauncherAlreadyVisible, this::onAnimatorPlaybackControllerCreated);
                maybeUpdateRecentsAttachedState(false /* animate */);
            };
+1 −1
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ public final class FallbackActivityInterface extends

    /** 6 */
    @Override
    public AnimationFactory prepareRecentsUI(
    public AnimationFactory prepareRecentsUI(RecentsAnimationDeviceState deviceState,
            boolean activityVisible, Consumer<AnimatorPlaybackController> callback) {
        DefaultAnimationFactory factory = new DefaultAnimationFactory(callback);
        factory.initUI();
+5 −1
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.view.animation.Interpolator;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;

import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
@@ -118,8 +119,11 @@ public final class LauncherActivityInterface extends
    }

    @Override
    public AnimationFactory prepareRecentsUI(
    public AnimationFactory prepareRecentsUI(RecentsAnimationDeviceState deviceState,
            boolean activityVisible, Consumer<AnimatorPlaybackController> callback) {
        ((RecentsView) getCreatedActivity().getOverviewPanel())
                .setLayoutRotation(deviceState.getCurrentActiveRotation(),
                        deviceState.getDisplayRotation());
        DefaultAnimationFactory factory = new DefaultAnimationFactory(callback) {
            @Override
            public void setShelfState(ShelfAnimState shelfState, Interpolator interpolator,
Loading