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

Commit 12dc76e7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Move rotation logic to RotationTouchHelper" into...

Merge "Move rotation logic to RotationTouchHelper" into ub-launcher3-rvc-qpr-dev am: eb2eb38c am: eb682915

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12155343

Change-Id: Idd86a05c6b3d4a1765d53ccea81b509d7b779acb
parents c2ceba35 eb682915
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -392,7 +392,8 @@ public abstract class BaseSwipeUpHandlerV2<T extends StatefulActivity<?>, Q exte
                mOnDeferredActivityLaunch);

        mGestureState.runOnceAtState(STATE_END_TARGET_SET,
                () -> mDeviceState.onEndTargetCalculated(mGestureState.getEndTarget(),
                () -> mDeviceState.getRotationTouchHelper().
                        onEndTargetCalculated(mGestureState.getEndTarget(),
                        mActivityInterface));

        notifyGestureStartedAsync();
+1 −1
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ public final class FallbackActivityInterface extends
    }

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

+6 −6
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ public final class LauncherActivityInterface extends
        // recents, we assume the first task is invisible, making translation off by one task.
        launcher.getStateManager().reapplyState();
        launcher.getRootView().setForceHideBackArrow(false);
        notifyRecentsOfOrientation(deviceState);
        notifyRecentsOfOrientation(deviceState.getRotationTouchHelper());
    }

    @Override
@@ -120,7 +120,7 @@ public final class LauncherActivityInterface extends
    @Override
    public AnimationFactory prepareRecentsUI(RecentsAnimationDeviceState deviceState,
            boolean activityVisible, Consumer<AnimatorPlaybackController> callback) {
        notifyRecentsOfOrientation(deviceState);
        notifyRecentsOfOrientation(deviceState.getRotationTouchHelper());
        DefaultAnimationFactory factory = new DefaultAnimationFactory(callback) {
            @Override
            public void setShelfState(ShelfAnimState shelfState, Interpolator interpolator,
@@ -228,7 +228,7 @@ public final class LauncherActivityInterface extends


    @Override
    public void onExitOverview(RecentsAnimationDeviceState deviceState, Runnable exitRunnable) {
    public void onExitOverview(RotationTouchHelper deviceState, Runnable exitRunnable) {
        final StateManager<LauncherState> stateManager = getCreatedActivity().getStateManager();
        stateManager.addStateListener(
                new StateManager.StateListener<LauncherState>() {
@@ -244,11 +244,11 @@ public final class LauncherActivityInterface extends
                });
    }

    private void notifyRecentsOfOrientation(RecentsAnimationDeviceState deviceState) {
    private void notifyRecentsOfOrientation(RotationTouchHelper rotationTouchHelper) {
        // reset layout on swipe to home
        RecentsView recentsView = getCreatedActivity().getOverviewPanel();
        recentsView.setLayoutRotation(deviceState.getCurrentActiveRotation(),
                deviceState.getDisplayRotation());
        recentsView.setLayoutRotation(rotationTouchHelper.getCurrentActiveRotation(),
                rotationTouchHelper.getDisplayRotation());
    }

    @Override
+2 −1
Original line number Diff line number Diff line
@@ -82,7 +82,8 @@ public abstract class SwipeUpAnimationLogic {
        mTransformParams = transformParams;

        mTaskViewSimulator.setLayoutRotation(
                mDeviceState.getCurrentActiveRotation(), mDeviceState.getDisplayRotation());
                mDeviceState.getRotationTouchHelper().getCurrentActiveRotation(),
                mDeviceState.getRotationTouchHelper().getDisplayRotation());
    }

    protected void initTransitionEndpoints(DeviceProfile dp) {
+6 −4
Original line number Diff line number Diff line
@@ -257,6 +257,7 @@ public class TouchInteractionService extends Service implements PluginListener<O

    private static boolean sConnected = false;
    private static boolean sIsInitialized = false;
    private RotationTouchHelper mRotationTouchHelper;

    public static boolean isConnected() {
        return sConnected;
@@ -297,6 +298,7 @@ public class TouchInteractionService extends Service implements PluginListener<O
        mDeviceState = new RecentsAnimationDeviceState(this);
        mDeviceState.addNavigationModeChangedCallback(this::onNavigationModeChanged);
        mDeviceState.runOnUserUnlocked(this::onUserUnlocked);
        mRotationTouchHelper = mDeviceState.getRotationTouchHelper();
        ProtoTracer.INSTANCE.get(this).add(this);

        sConnected = true;
@@ -325,7 +327,7 @@ public class TouchInteractionService extends Service implements PluginListener<O
        mInputEventReceiver = mInputMonitorCompat.getInputReceiver(Looper.getMainLooper(),
                mMainChoreographer, this::onInputEvent);

        mDeviceState.updateGestureTouchRegions();
        mRotationTouchHelper.updateGestureTouchRegions();
    }

    /**
@@ -469,9 +471,9 @@ public class TouchInteractionService extends Service implements PluginListener<O
            if (TestProtocol.sDebugTracing) {
                Log.d(TestProtocol.NO_SWIPE_TO_HOME, "TouchInteractionService.onInputEvent:DOWN");
            }
            mDeviceState.setOrientationTransformIfNeeded(event);
            mRotationTouchHelper.setOrientationTransformIfNeeded(event);

            if (mDeviceState.isInSwipeUpTouchRegion(event)) {
            if (mRotationTouchHelper.isInSwipeUpTouchRegion(event)) {
                if (TestProtocol.sDebugTracing) {
                    Log.d(TestProtocol.NO_SWIPE_TO_HOME,
                            "TouchInteractionService.onInputEvent:isInSwipeUpTouchRegion");
@@ -508,7 +510,7 @@ public class TouchInteractionService extends Service implements PluginListener<O
            // Other events
            if (mUncheckedConsumer != InputConsumer.NO_OP) {
                // Only transform the event if we are handling it in a proper consumer
                mDeviceState.setOrientationTransformIfNeeded(event);
                mRotationTouchHelper.setOrientationTransformIfNeeded(event);
            }
        }

Loading