Merge "Fix some touch issues during gesture nav transition" into sc-dev am: 6348858734
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15137733
Change-Id: I298c261a148e909d1f68926b6d865fa6f2b44825
diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
index 6423352..c04d15f 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -233,6 +233,7 @@
// Used to control launcher components throughout the swipe gesture.
private AnimatorControllerWithResistance mLauncherTransitionController;
+ private boolean mHasEndedLauncherTransition;
private AnimationFactory mAnimationFactory = (t) -> { };
@@ -617,11 +618,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
@@ -1456,6 +1457,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 3b32289..0103acf 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -1300,8 +1300,14 @@
}
private void updateOrientationHandler() {
+ updateOrientationHandler(true);
+ }
+
+ private void updateOrientationHandler(boolean forceRecreateDragLayerControllers) {
// Handle orientation changes.
+ PagedOrientationHandler oldOrientationHandler = mOrientationHandler;
mOrientationHandler = mOrientationState.getOrientationHandler();
+
mIsRtl = mOrientationHandler.getRecentsRtlSetting(getResources());
setLayoutDirection(mIsRtl
? View.LAYOUT_DIRECTION_RTL
@@ -1310,7 +1316,13 @@
? View.LAYOUT_DIRECTION_LTR
: View.LAYOUT_DIRECTION_RTL);
mClearAllButton.setRotation(mOrientationHandler.getDegreesRotated());
- mActivity.getDragLayer().recreateControllers();
+
+ if (forceRecreateDragLayerControllers
+ || !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,
@@ -1638,7 +1650,7 @@
setCurrentPage(0);
LayoutUtils.setViewEnabled(mActionsView, true);
if (mOrientationState.setGestureActive(false)) {
- updateOrientationHandler();
+ updateOrientationHandler(/* forceRecreateDragLayerControllers = */ false);
}
});
}