diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/OtherActivityInputConsumer.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/OtherActivityInputConsumer.java index 833a46845b..7fc5d502f9 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/OtherActivityInputConsumer.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/OtherActivityInputConsumer.java @@ -45,6 +45,7 @@ import android.view.ViewConfiguration; import android.view.WindowManager; import com.android.launcher3.R; +import com.android.launcher3.graphics.RotationMode; import com.android.launcher3.util.Preconditions; import com.android.launcher3.util.RaceConditionTracker; import com.android.launcher3.util.TraceHelper; @@ -164,8 +165,10 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC // Proxy events to recents view if (mPassedDragSlop && mInteractionHandler != null && !mRecentsViewDispatcher.hasConsumer()) { - mRecentsViewDispatcher.setConsumer(mInteractionHandler - .getRecentsViewDispatcher(isNavBarOnLeft() || isNavBarOnRight())); + mRecentsViewDispatcher.setConsumer(mInteractionHandler.getRecentsViewDispatcher( + isNavBarOnLeft() + ? RotationMode.SEASCAPE + : (isNavBarOnRight() ? RotationMode.LANDSCAPE : RotationMode.NORMAL))); } int edgeFlags = ev.getEdgeFlags(); ev.setEdgeFlags(edgeFlags | EDGE_NAV_BAR); @@ -402,15 +405,13 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC } private float getDisplacement(MotionEvent ev) { - final float displacement; if (isNavBarOnRight()) { - displacement = ev.getX() - mDownPos.x; + return ev.getX() - mDownPos.x; } else if (isNavBarOnLeft()) { - displacement = mDownPos.x - ev.getX(); + return mDownPos.x - ev.getX(); } else { - displacement = ev.getY() - mDownPos.y; + return ev.getY() - mDownPos.y; } - return displacement; } @Override diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java index 30fce527a6..9c6102e22c 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java @@ -77,6 +77,7 @@ import com.android.launcher3.Utilities; import com.android.launcher3.anim.AnimationSuccessListener; import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.anim.Interpolators; +import com.android.launcher3.graphics.RotationMode; import com.android.launcher3.logging.UserEventDispatcher; import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction; import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch; @@ -533,8 +534,8 @@ public class WindowTransformSwipeHandler return TaskView.getCurveScaleForInterpolation(interpolation); } - public Consumer getRecentsViewDispatcher(boolean isTransposed) { - return mRecentsView != null ? mRecentsView.getEventDispatcher(isTransposed) : null; + public Consumer getRecentsViewDispatcher(RotationMode rotationMode) { + return mRecentsView != null ? mRecentsView.getEventDispatcher(rotationMode) : null; } @UiThread 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 2fdfda1c6a..b5f90a5550 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 @@ -83,6 +83,7 @@ import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.anim.PropertyListBuilder; import com.android.launcher3.anim.SpringObjectAnimator; import com.android.launcher3.config.FeatureFlags; +import com.android.launcher3.graphics.RotationMode; import com.android.launcher3.userevent.nano.LauncherLogProto; import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction; import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch; @@ -1641,10 +1642,10 @@ public abstract class RecentsView extends PagedView impl return mClearAllButton; } - public Consumer getEventDispatcher(boolean isTransposed) { - if (isTransposed) { + public Consumer getEventDispatcher(RotationMode rotationMode) { + if (rotationMode.isTransposed) { Matrix transform = new Matrix(); - transform.setRotate(90); + transform.setRotate(-rotationMode.surfaceRotation); if (getWidth() > 0 && getHeight() > 0) { float scale = ((float) getWidth()) / getHeight();