From 7ce0d39c41b7620d5d1690e17913b4b22db16dd0 Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Tue, 21 Nov 2023 19:15:02 -0800 Subject: [PATCH] [taskbar/navbar unification] Do not shift back button after unlocking in phone mode Fixes: 312495129 Test: Back button doesn't move (stay on the left side) when unlocking from the small screen. Back button shifts from the right side to the final position after unlocking from the big screen Change-Id: Idd9379cee0a0be49c443ee485b4dc0f4ea248366 --- .../taskbar/NavbarButtonsViewController.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java index 0ef454150b..3514447ad1 100644 --- a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java @@ -26,6 +26,7 @@ import static com.android.launcher3.Utilities.getDescendantCoordRelativeToAncest import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_NAVBAR_UNIFICATION; import static com.android.launcher3.taskbar.LauncherTaskbarUIController.SYSUI_SURFACE_PROGRESS_INDEX; import static com.android.launcher3.taskbar.TaskbarManager.isPhoneButtonNavMode; +import static com.android.launcher3.taskbar.TaskbarManager.isPhoneMode; import static com.android.launcher3.taskbar.TaskbarNavButtonController.BUTTON_A11Y; import static com.android.launcher3.taskbar.TaskbarNavButtonController.BUTTON_BACK; import static com.android.launcher3.taskbar.TaskbarNavButtonController.BUTTON_HOME; @@ -380,10 +381,12 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT int navButtonSize = mContext.getResources().getDimensionPixelSize( R.dimen.taskbar_nav_buttons_size); boolean isRtl = Utilities.isRtl(mContext.getResources()); - mPropertyHolders.add(new StatePropertyHolder( - mBackButton, flags -> (flags & FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE) != 0 - || (flags & FLAG_KEYGUARD_VISIBLE) != 0, - VIEW_TRANSLATE_X, navButtonSize * (isRtl ? -2 : 2), 0)); + if (!isPhoneMode(mContext.getDeviceProfile())) { + mPropertyHolders.add(new StatePropertyHolder( + mBackButton, flags -> (flags & FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE) != 0 + || (flags & FLAG_KEYGUARD_VISIBLE) != 0, + VIEW_TRANSLATE_X, navButtonSize * (isRtl ? -2 : 2), 0)); + } // home button mHomeButton = addButton(R.drawable.ic_sysbar_home, BUTTON_HOME, navContainer,