Merge "Polish hotseat and taskbar with 3 buttons" into tm-qpr-dev am: 4537638dfd am: 0d5ca5fe6f

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20533919

Change-Id: I37921b47514fc4823b2c6ee7d61fbf1ff6ca7c67
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Alex Chau
2022-12-19 12:26:25 +00:00
committed by Automerger Merge Worker
9 changed files with 125 additions and 109 deletions

View File

@@ -152,10 +152,10 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
TaskbarNavButtonController buttonController, ScopedUnfoldTransitionProgressProvider
unfoldTransitionProgressProvider) {
super(windowContext);
mDeviceProfile = launcherDp.copy(this);
final Resources resources = getResources();
matchDeviceProfile(launcherDp, getResources());
mNavMode = DisplayController.getNavigationMode(windowContext);
mImeDrawsImeNavBar = getBoolByName(IME_DRAWS_IME_NAV_BAR_RES_NAME, resources, false);
mIsSafeModeEnabled = TraceHelper.allowIpcs("isSafeMode",
@@ -171,8 +171,6 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
mIsNavBarKidsMode = settingsCache.getValue(
Settings.Secure.getUriFor(Settings.Secure.NAV_BAR_KIDS_MODE), 0);
updateIconSize(resources);
// Get display and corners first, as views might use them in constructor.
Display display = windowContext.getDisplay();
Context c = display.getDisplayId() == Display.DEFAULT_DISPLAY
@@ -260,8 +258,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
public void updateDeviceProfile(DeviceProfile launcherDp, NavigationMode navMode) {
mNavMode = navMode;
mControllers.taskbarOverlayController.updateLauncherDeviceProfile(launcherDp);
mDeviceProfile = launcherDp.copy(this);
updateIconSize(getResources());
matchDeviceProfile(launcherDp, getResources());
AbstractFloatingView.closeAllOpenViewsExcept(this, false, TYPE_REBIND_SAFE);
// Reapply fullscreen to take potential new screen size into account.
@@ -270,6 +267,21 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
dispatchDeviceProfileChanged();
}
/**
* Copy the original DeviceProfile, match the number of hotseat icons and qsb width and update
* the icon size
*/
private void matchDeviceProfile(DeviceProfile originDeviceProfile, Resources resources) {
mDeviceProfile = originDeviceProfile.copy(this);
// Taskbar should match the number of icons of hotseat
mDeviceProfile.numShownHotseatIcons = originDeviceProfile.numShownHotseatIcons;
// Same QSB width to have a smooth animation
mDeviceProfile.hotseatQsbWidth = originDeviceProfile.hotseatQsbWidth;
// Update the size of the icons
updateIconSize(resources);
}
private void updateIconSize(Resources resources) {
mDeviceProfile.iconSizePx = resources.getDimensionPixelSize(
DisplayController.isTransientTaskbar(this)