diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java index f50bb3e59a..1d1c7bb4e2 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java @@ -45,6 +45,7 @@ import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimationSuccessListener; import com.android.launcher3.anim.AnimatorPlaybackController; +import com.android.launcher3.graphics.RotationMode; import com.android.launcher3.model.PagedViewOrientedState; import com.android.launcher3.states.RotationHelper; import com.android.launcher3.touch.PagedOrientationHandler; @@ -146,8 +147,8 @@ public abstract class BaseSwipeUpHandler getRecentsViewDispatcher() { - return mRecentsView != null ? mRecentsView.getEventDispatcher() : null; + public Consumer getRecentsViewDispatcher(RotationMode navBarRotationMode) { + return mRecentsView != null ? mRecentsView.getEventDispatcher(navBarRotationMode) : null; } @UiThread diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java index bd9f330082..893868bdf8 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java @@ -176,7 +176,8 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC // Proxy events to recents view if (mPassedWindowMoveSlop && mInteractionHandler != null && !mRecentsViewDispatcher.hasConsumer()) { - mRecentsViewDispatcher.setConsumer(mInteractionHandler.getRecentsViewDispatcher()); + mRecentsViewDispatcher.setConsumer(mInteractionHandler + .getRecentsViewDispatcher(mNavBarPosition.getRotationMode())); } int edgeFlags = ev.getEdgeFlags(); ev.setEdgeFlags(edgeFlags | EDGE_NAV_BAR); diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java index c201455cd2..72e6391707 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java @@ -96,6 +96,7 @@ import com.android.launcher3.anim.SpringObjectAnimator; import com.android.launcher3.compat.AccessibilityManagerCompat; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.dragndrop.DragLayer; +import com.android.launcher3.graphics.RotationMode; import com.android.launcher3.states.RotationHelper; import com.android.launcher3.touch.PagedOrientationHandler.CurveProperties; import com.android.launcher3.userevent.nano.LauncherLogProto; @@ -1946,8 +1947,13 @@ public abstract class RecentsView extends PagedView impl return offsetX; } - public Consumer getEventDispatcher() { - int degreesRotated = RotationHelper.getDegreesFromRotation(mLayoutRotation); + public Consumer getEventDispatcher(RotationMode navBarRotationMode) { + float degreesRotated; + if (navBarRotationMode == RotationMode.NORMAL) { + degreesRotated = RotationHelper.getDegreesFromRotation(mLayoutRotation); + } else { + degreesRotated = -navBarRotationMode.surfaceRotation; + } if (degreesRotated == 0) { return super::onTouchEvent; } diff --git a/src/com/android/launcher3/states/RotationHelper.java b/src/com/android/launcher3/states/RotationHelper.java index 3b134b0c03..b47ef72424 100644 --- a/src/com/android/launcher3/states/RotationHelper.java +++ b/src/com/android/launcher3/states/RotationHelper.java @@ -17,7 +17,6 @@ package com.android.launcher3.states; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LOCKED; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_NOSENSOR; -import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; import static android.util.DisplayMetrics.DENSITY_DEVICE_STABLE; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; @@ -277,7 +276,7 @@ public class RotationHelper implements OnSharedPreferenceChangeListener { * Creates a matrix to transform the given motion event specified by degrees. * If {@param inverse} is {@code true}, the inverse of that matrix will be applied */ - public static void transformEvent(int degrees, MotionEvent ev, boolean inverse) { + public static void transformEvent(float degrees, MotionEvent ev, boolean inverse) { Matrix transform = new Matrix(); transform.setRotate(degrees); if (inverse) {