From 90b006dbe5a826156e6d6ef69a3d353e3968a9e4 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Fri, 22 May 2020 21:48:19 -0700 Subject: [PATCH] Reset Overview layout after swiping to home Reset overview when user does a swipe to home gesture. Preivously we only rest when user first when to over, and then swiped to home. Fixes: 156053957 Change-Id: I5a157f9e2229aba4b36851bd46d704a39d647110 --- .../android/quickstep/BaseSwipeUpHandlerV2.java | 2 +- .../quickstep/FallbackActivityInterface.java | 2 +- .../quickstep/LauncherActivityInterface.java | 16 ++++++++++------ .../android/quickstep/BaseActivityInterface.java | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandlerV2.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandlerV2.java index 46799ff272..c92dd5068b 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandlerV2.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandlerV2.java @@ -1035,7 +1035,7 @@ public abstract class BaseSwipeUpHandlerV2, Q exte } // Make sure recents is in its final state maybeUpdateRecentsAttachedState(false); - mActivityInterface.onSwipeUpToHomeComplete(); + mActivityInterface.onSwipeUpToHomeComplete(mDeviceState); } }); return anim; diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackActivityInterface.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackActivityInterface.java index c9ff88409a..70be3ab8af 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackActivityInterface.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackActivityInterface.java @@ -69,7 +69,7 @@ public final class FallbackActivityInterface extends /** 4 */ @Override - public void onSwipeUpToHomeComplete() { + public void onSwipeUpToHomeComplete(RecentsAnimationDeviceState deviceState) { onSwipeUpToRecentsComplete(); } diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityInterface.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityInterface.java index 13b84e036e..62eb235251 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityInterface.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityInterface.java @@ -96,7 +96,7 @@ public final class LauncherActivityInterface extends } @Override - public void onSwipeUpToHomeComplete() { + public void onSwipeUpToHomeComplete(RecentsAnimationDeviceState deviceState) { Launcher launcher = getCreatedActivity(); if (launcher == null) { return; @@ -105,6 +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); } @Override @@ -235,17 +236,20 @@ public final class LauncherActivityInterface extends // Are we going from Recents to Workspace? if (toState == LauncherState.NORMAL) { exitRunnable.run(); - - // reset layout on swipe to home - RecentsView recentsView = getCreatedActivity().getOverviewPanel(); - recentsView.setLayoutRotation(deviceState.getCurrentActiveRotation(), - deviceState.getDisplayRotation()); + notifyRecentsOfOrientation(deviceState); stateManager.removeStateListener(this); } } }); } + private void notifyRecentsOfOrientation(RecentsAnimationDeviceState deviceState) { + // reset layout on swipe to home + RecentsView recentsView = getCreatedActivity().getOverviewPanel(); + recentsView.setLayoutRotation(deviceState.getCurrentActiveRotation(), + deviceState.getDisplayRotation()); + } + @Override public Rect getOverviewWindowBounds(Rect homeBounds, RemoteAnimationTargetCompat target) { return homeBounds; diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java index 91249250f5..7122647e6f 100644 --- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java +++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java @@ -101,7 +101,7 @@ public abstract class BaseActivityInterface