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

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

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

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

Change-Id: I504871c83bd89d0fc895f6df2d93a7c9023c8cd8
parents d84cdd36 eb2eb38c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -397,7 +397,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
@@ -258,6 +258,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;
@@ -298,6 +299,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;
@@ -326,7 +328,7 @@ public class TouchInteractionService extends Service implements PluginListener<O
        mInputEventReceiver = mInputMonitorCompat.getInputReceiver(Looper.getMainLooper(),
                mMainChoreographer, this::onInputEvent);

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

    /**
@@ -470,9 +472,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");
@@ -509,7 +511,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