Merge "Fix some touch issues during gesture nav transition" into sc-dev am: 8db306f3c5
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15081302
Change-Id: I6d3469f46d2bf98e12f9e2078a21d550b96e7435
diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
index 4d47ef1..d511e6d 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -230,6 +230,7 @@
// Used to control launcher components throughout the swipe gesture.
private AnimatorControllerWithResistance mLauncherTransitionController;
+ private boolean mHasEndedLauncherTransition;
private AnimationFactory mAnimationFactory = (t) -> { };
@@ -603,11 +604,11 @@
/**
* We don't want to change mLauncherTransitionController if mGestureState.getEndTarget() == HOME
- * (it has its own animation).
+ * (it has its own animation) or if we explicitly ended the controller already.
* @return Whether we can create the launcher controller or update its progress.
*/
private boolean canCreateNewOrUpdateExistingLauncherTransitionController() {
- return mGestureState.getEndTarget() != HOME;
+ return mGestureState.getEndTarget() != HOME && !mHasEndedLauncherTransition;
}
@Override
@@ -1421,6 +1422,8 @@
}
private void endLauncherTransitionController() {
+ mHasEndedLauncherTransition = true;
+
if (mLauncherTransitionController != null) {
// End the animation, but stay at the same visual progress.
mLauncherTransitionController.getNormalController().dispatchSetInterpolator(
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 000a95d..8b7af04 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -1251,7 +1251,9 @@
private void updateOrientationHandler() {
// Handle orientation changes.
+ PagedOrientationHandler oldOrientationHandler = mOrientationHandler;
mOrientationHandler = mOrientationState.getOrientationHandler();
+
mIsRtl = mOrientationHandler.getRecentsRtlSetting(getResources());
setLayoutDirection(mIsRtl
? View.LAYOUT_DIRECTION_RTL
@@ -1260,7 +1262,12 @@
? View.LAYOUT_DIRECTION_LTR
: View.LAYOUT_DIRECTION_RTL);
mClearAllButton.setRotation(mOrientationHandler.getDegreesRotated());
- mActivity.getDragLayer().recreateControllers();
+
+ if (!mOrientationHandler.equals(oldOrientationHandler)) {
+ // Changed orientations, update controllers so they intercept accordingly.
+ mActivity.getDragLayer().recreateControllers();
+ }
+
boolean isInLandscape = mOrientationState.getTouchRotation() != ROTATION_0
|| mOrientationState.getRecentsActivityRotation() != ROTATION_0;
mActionsView.updateHiddenFlags(HIDDEN_NON_ZERO_ROTATION,