diff --git a/quickstep/res/values-land/dimens.xml b/quickstep/res/values-land/dimens.xml index 905fbda7a3..bc5d02afb9 100644 --- a/quickstep/res/values-land/dimens.xml +++ b/quickstep/res/values-land/dimens.xml @@ -80,4 +80,8 @@ 219.6dp 84dp 79dp + 48dp + 96dp + 24dp + \ No newline at end of file diff --git a/quickstep/res/values/dimens.xml b/quickstep/res/values/dimens.xml index 765d36c4d3..425d9c326b 100644 --- a/quickstep/res/values/dimens.xml +++ b/quickstep/res/values/dimens.xml @@ -258,7 +258,10 @@ 16dp 8dp 44dp - 48dp + 48dp + 120dp + 48dp + 48dp 24dp 35dp 24dp diff --git a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java index 725ce11dd0..339f3a9174 100644 --- a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java @@ -204,8 +204,10 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT DeviceProfile deviceProfile = mContext.getDeviceProfile(); Resources resources = mContext.getResources(); mNavButtonsView.getLayoutParams().height = !isPhoneMode(deviceProfile) ? - deviceProfile.taskbarSize : - resources.getDimensionPixelSize(R.dimen.taskbar_size); + mContext.isUserSetupComplete() + ? deviceProfile.taskbarSize + : resources.getDimensionPixelSize(R.dimen.taskbar_suw_frame) + : resources.getDimensionPixelSize(R.dimen.taskbar_size); mIsImeRenderingNavButtons = InputMethodService.canImeRenderGesturalNavButtons() && mContext.imeDrawsImeNavBar(); @@ -267,15 +269,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT updateButtonLayoutSpacing(); updateStateForFlag(FLAG_SMALL_SCREEN, isPhoneButtonNavMode(mContext)); if (isInSetup) { - // Since setup wizard only has back button enabled, it looks strange to be - // end-aligned, so start-align instead. - FrameLayout.LayoutParams navButtonsLayoutParams = (FrameLayout.LayoutParams) - mNavButtonContainer.getLayoutParams(); - navButtonsLayoutParams.setMarginStart( - resources.getDimensionPixelSize(R.dimen.taskbar_contextual_button_margin)); - navButtonsLayoutParams.setMarginEnd(0); - navButtonsLayoutParams.gravity = Gravity.START; - mNavButtonContainer.requestLayout(); + handleSetupUi(); // Hide back button in SUW if keyboard is showing (IME draws its own back). mPropertyHolders.add(new StatePropertyHolder( @@ -745,14 +739,38 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT if (mFloatingRotationButton != null) { mFloatingRotationButton.onConfigurationChanged(configChanges); } + if (!mContext.isUserSetupComplete()) { + handleSetupUi(); + } updateButtonLayoutSpacing(); } + private void handleSetupUi() { + // Since setup wizard only has back button enabled, it looks strange to be + // end-aligned, so start-align instead. + FrameLayout.LayoutParams navButtonsLayoutParams = (FrameLayout.LayoutParams) + mNavButtonContainer.getLayoutParams(); + Resources resources = mContext.getResources(); + DeviceProfile deviceProfile = mContext.getDeviceProfile(); + int setupMargin = resources.getDimensionPixelSize(R.dimen.taskbar_contextual_button_margin); + navButtonsLayoutParams.setMarginStart(setupMargin); + navButtonsLayoutParams.bottomMargin = !deviceProfile.isLandscape + ? 0 + : setupMargin - + (resources.getDimensionPixelSize(R.dimen.taskbar_nav_buttons_size) / 2); + navButtonsLayoutParams.setMarginEnd(0); + navButtonsLayoutParams.gravity = Gravity.START; + mNavButtonContainer.setLayoutParams(navButtonsLayoutParams); + mNavButtonContainer.requestLayout(); + } + /** - * Adds the correct spacing to 3 button nav container. No-op if using gesture nav or kids mode. + * Adds the correct spacing to 3 button nav container. No-op if using gesture nav, setup + * is incomplete, or in kids mode. */ private void updateButtonLayoutSpacing() { - if (!mContext.isThreeButtonNav() || mContext.isNavBarKidsModeActive()) { + if (!mContext.isThreeButtonNav() || mContext.isNavBarKidsModeActive() + || !mContext.isUserSetupComplete()) { return; } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index 9d15ea88c3..c69dc0d8c4 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -148,11 +148,12 @@ public class TaskbarActivityContext extends BaseTaskbarContext { mImeDrawsImeNavBar = getBoolByName(IME_DRAWS_IME_NAV_BAR_RES_NAME, resources, false); mIsSafeModeEnabled = TraceHelper.allowIpcs("isSafeMode", () -> getPackageManager().isSafeMode()); - mIsUserSetupComplete = SettingsCache.INSTANCE.get(this).getValue( + SettingsCache settingsCache = SettingsCache.INSTANCE.get(this); + mIsUserSetupComplete = settingsCache.getValue( Settings.Secure.getUriFor(Settings.Secure.USER_SETUP_COMPLETE), 0); - mIsNavBarForceVisible = SettingsCache.INSTANCE.get(this).getValue( + mIsNavBarForceVisible = settingsCache.getValue( Settings.Secure.getUriFor(Settings.Secure.NAV_BAR_KIDS_MODE), 0); - mIsNavBarKidsMode = SettingsCache.INSTANCE.get(this).getValue( + mIsNavBarKidsMode = settingsCache.getValue( Settings.Secure.getUriFor(Settings.Secure.NAV_BAR_KIDS_MODE), 0); updateIconSize(resources); @@ -614,6 +615,10 @@ public class TaskbarActivityContext extends BaseTaskbarContext { resources.getDimensionPixelSize(R.dimen.taskbar_size) : resources.getDimensionPixelSize(R.dimen.taskbar_stashed_size); } + + if (!isUserSetupComplete()) { + return getResources().getDimensionPixelSize(R.dimen.taskbar_suw_frame); + } return mDeviceProfile.taskbarSize + Math.max(getLeftCornerRadius(), getRightCornerRadius()); } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java index b9bcf1bb81..98a1b016ba 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java @@ -354,6 +354,11 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba } return mStashedHeight; } + + if (!mActivity.isUserSetupComplete()) { + // Special insets for SUW. + return mActivity.getResources().getDimensionPixelSize(R.dimen.taskbar_suw_insets); + } return mUnstashedHeight; } diff --git a/quickstep/src/com/android/quickstep/views/SplitInstructionsView.java b/quickstep/src/com/android/quickstep/views/SplitInstructionsView.java index fae96dc49c..b0b111d376 100644 --- a/quickstep/src/com/android/quickstep/views/SplitInstructionsView.java +++ b/quickstep/src/com/android/quickstep/views/SplitInstructionsView.java @@ -121,7 +121,7 @@ public class SplitInstructionsView extends FrameLayout { int navButtonWidth = getResources().getDimensionPixelSize( R.dimen.taskbar_nav_buttons_size); int extraMargin = getResources().getDimensionPixelSize( - R.dimen.taskbar_contextual_button_margin); + R.dimen.taskbar_split_instructions_margin); // Explanation: The 3-button nav for non-phones sits on one side of the screen, taking // up 3 buttons + a side margin worth of space. Our splitInstructionsView starts in the // center of the screen and we want to center it in the remaining space, therefore we