Fix window clipped in three-button-nav on phone factors
Since three-button-nav is transparent on phone factors, the bottom insets should not be clipped.
Bug: 373544911
Test: Manual, i.e. verifying that the window clipping is correct in all combinations of (tablet, phone) x (three-button--nav, gesture-nav)
Flag: com.android.window.flags.predictive_back_three_button_nav
Change-Id: Ie15b899a3e79514976868ff574faf1d02816822f
diff --git a/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java b/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java
index 1124aac..6719ab7 100644
--- a/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java
+++ b/quickstep/src/com/android/quickstep/LauncherBackAnimationController.java
@@ -24,6 +24,7 @@
import static com.android.launcher3.BaseActivity.INVISIBLE_ALL;
import static com.android.launcher3.BaseActivity.INVISIBLE_BY_PENDING_FLAGS;
import static com.android.launcher3.BaseActivity.PENDING_INVISIBLE_BY_WALLPAPER_ANIMATION;
+import static com.android.window.flags.Flags.predictiveBackThreeButtonNav;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -60,6 +61,8 @@
import com.android.launcher3.Utilities;
import com.android.launcher3.taskbar.LauncherTaskbarUIController;
import com.android.launcher3.uioverrides.QuickstepLauncher;
+import com.android.launcher3.util.DisplayController;
+import com.android.launcher3.util.NavigationMode;
import com.android.launcher3.widget.LauncherAppWidgetHostView;
import com.android.quickstep.util.BackAnimState;
import com.android.systemui.shared.system.QuickStepContract;
@@ -295,8 +298,11 @@
mStartRect.set(appTarget.windowConfiguration.getMaxBounds());
- // inset bottom in case of pinned taskbar being present
- mStartRect.inset(0, 0, 0, appTarget.contentInsets.bottom);
+ // inset bottom in case of taskbar being present
+ if (!predictiveBackThreeButtonNav() || mLauncher.getDeviceProfile().isTaskbarPresent
+ || DisplayController.getNavigationMode(mLauncher) == NavigationMode.NO_BUTTON) {
+ mStartRect.inset(0, 0, 0, appTarget.contentInsets.bottom);
+ }
mLauncherTargetView = mQuickstepTransitionManager.findLauncherView(
new RemoteAnimationTarget[]{ mBackTarget });