Loading quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java +2 −2 Original line number Diff line number Diff line Loading @@ -237,7 +237,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT DeviceProfile deviceProfile = mContext.getDeviceProfile(); Resources resources = mContext.getResources(); Point p = !mContext.isUserSetupComplete() ? new Point(0, mControllers.taskbarActivityContext.getSetupWindowHeight()) ? new Point(0, mControllers.taskbarActivityContext.getSetupWindowSize()) : DimensionUtils.getTaskbarPhoneDimensions(deviceProfile, resources, mContext.isPhoneMode()); mNavButtonsView.getLayoutParams().height = p.y; Loading Loading @@ -733,7 +733,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT navButtonsLayoutParams.setMarginEnd(0); navButtonsLayoutParams.gravity = Gravity.START; mNavButtonsView.getLayoutParams().height = mControllers.taskbarActivityContext.getSetupWindowHeight(); mControllers.taskbarActivityContext.getSetupWindowSize(); mNavButtonContainer.setLayoutParams(navButtonsLayoutParams); } Loading quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +28 −19 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { private WindowManager.LayoutParams mWindowLayoutParams; private boolean mIsFullscreen; // The size we should return to when we call setTaskbarWindowFullscreen(false) private int mLastRequestedNonFullscreenHeight; private int mLastRequestedNonFullscreenSize; private NavigationMode mNavMode; private boolean mImeDrawsImeNavBar; Loading Loading @@ -364,7 +364,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { public void init(@NonNull TaskbarSharedState sharedState) { mImeDrawsImeNavBar = getBoolByName(IME_DRAWS_IME_NAV_BAR_RES_NAME, getResources(), false); mLastRequestedNonFullscreenHeight = getDefaultTaskbarWindowHeight(); mLastRequestedNonFullscreenSize = getDefaultTaskbarWindowSize(); mWindowLayoutParams = createAllWindowParams(); // Initialize controllers after all are constructed. Loading Loading @@ -485,7 +485,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { } WindowManager.LayoutParams windowLayoutParams = new WindowManager.LayoutParams( MATCH_PARENT, mLastRequestedNonFullscreenHeight, mLastRequestedNonFullscreenSize, type, windowFlags, PixelFormat.TRANSLUCENT); Loading Loading @@ -530,16 +530,16 @@ public class TaskbarActivityContext extends BaseTaskbarContext { case Surface.ROTATION_0, Surface.ROTATION_180 -> { // Defaults are fine width = WindowManager.LayoutParams.MATCH_PARENT; height = mLastRequestedNonFullscreenHeight; height = mLastRequestedNonFullscreenSize; gravity = Gravity.BOTTOM; } case Surface.ROTATION_90 -> { width = mLastRequestedNonFullscreenHeight; width = mLastRequestedNonFullscreenSize; height = WindowManager.LayoutParams.MATCH_PARENT; gravity = Gravity.END; } case Surface.ROTATION_270 -> { width = mLastRequestedNonFullscreenHeight; width = mLastRequestedNonFullscreenSize; height = WindowManager.LayoutParams.MATCH_PARENT; gravity = Gravity.START; } Loading @@ -564,7 +564,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { public void onConfigurationChanged(@Config int configChanges) { mControllers.onConfigurationChanged(configChanges); if (!mIsUserSetupComplete) { setTaskbarWindowHeight(getSetupWindowHeight()); setTaskbarWindowSize(getSetupWindowSize()); } } Loading Loading @@ -871,7 +871,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { public void setTaskbarWindowFullscreen(boolean fullscreen) { setAutohideSuspendFlag(FLAG_AUTOHIDE_SUSPEND_FULLSCREEN, fullscreen); mIsFullscreen = fullscreen; setTaskbarWindowHeight(fullscreen ? MATCH_PARENT : mLastRequestedNonFullscreenHeight); setTaskbarWindowSize(fullscreen ? MATCH_PARENT : mLastRequestedNonFullscreenSize); } /** Loading @@ -896,16 +896,20 @@ public class TaskbarActivityContext extends BaseTaskbarContext { } /** * Updates the TaskbarContainer height (pass {@link #getDefaultTaskbarWindowHeight()} to reset). * Updates the TaskbarContainer size (pass {@link #getDefaultTaskbarWindowSize()} to reset). */ public void setTaskbarWindowHeight(int height) { if (mWindowLayoutParams.height == height || mIsDestroyed) { public void setTaskbarWindowSize(int size) { // In landscape phone button nav mode, we should set the task bar width instead of height // because this is the only case in which the nav bar is not on the display bottom. boolean landscapePhoneButtonNav = isPhoneButtonNavMode() && mDeviceProfile.isLandscape; if ((landscapePhoneButtonNav ? mWindowLayoutParams.width : mWindowLayoutParams.height) == size || mIsDestroyed) { return; } if (height == MATCH_PARENT) { height = mDeviceProfile.heightPx; if (size == MATCH_PARENT) { size = mDeviceProfile.heightPx; } else { mLastRequestedNonFullscreenHeight = height; mLastRequestedNonFullscreenSize = size; if (mIsFullscreen) { // We still need to be fullscreen, so defer any change to our height until we call // setTaskbarWindowFullscreen(false). For example, this could happen when dragging Loading @@ -914,15 +918,20 @@ public class TaskbarActivityContext extends BaseTaskbarContext { return; } } mWindowLayoutParams.height = height; if (landscapePhoneButtonNav) { mWindowLayoutParams.width = size; } else { mWindowLayoutParams.height = size; } mControllers.taskbarInsetsController.onTaskbarOrBubblebarWindowHeightOrInsetsChanged(); notifyUpdateLayoutParams(); } /** * Returns the default height of the window, including the static corner radii above taskbar. * Returns the default size (in most cases height, but in 3-button phone mode, width) of the * window, including the static corner radii above taskbar. */ public int getDefaultTaskbarWindowHeight() { public int getDefaultTaskbarWindowSize() { Resources resources = getResources(); if (ENABLE_TASKBAR_NAVBAR_UNIFICATION && mDeviceProfile.isPhone) { Loading @@ -932,7 +941,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { } if (!isUserSetupComplete()) { return getSetupWindowHeight(); return getSetupWindowSize(); } boolean shouldTreatAsTransient = DisplayController.isTransientTaskbar(this) Loading Loading @@ -963,7 +972,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { + extraHeightForTaskbarTooltips; } public int getSetupWindowHeight() { public int getSetupWindowSize() { return getResources().getDimensionPixelSize(R.dimen.taskbar_suw_frame); } Loading quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java +12 −4 Original line number Diff line number Diff line Loading @@ -684,9 +684,9 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar setter.addFloat(mThemedIconsBackgroundProgress, VALUE, 1f, 0f, LINEAR); } int collapsedHeight = mActivity.getDefaultTaskbarWindowHeight(); int collapsedHeight = mActivity.getDefaultTaskbarWindowSize(); int expandedHeight = Math.max(collapsedHeight, taskbarDp.taskbarHeight + offsetY); setter.addOnFrameListener(anim -> mActivity.setTaskbarWindowHeight( setter.addOnFrameListener(anim -> mActivity.setTaskbarWindowSize( anim.getAnimatedFraction() > 0 ? expandedHeight : collapsedHeight)); mTaskbarBottomMargin = isTransientTaskbar Loading Loading @@ -822,8 +822,16 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar // We only translate on rotation when icon is aligned with hotseat return; } mActivity.setTaskbarWindowHeight( deviceProfile.taskbarHeight + deviceProfile.getTaskbarOffsetY()); int taskbarWindowSize; if (mActivity.isPhoneMode()) { taskbarWindowSize = mActivity.getResources().getDimensionPixelSize( mActivity.isThreeButtonNav() ? R.dimen.taskbar_phone_size : R.dimen.taskbar_stashed_size); } else { taskbarWindowSize = deviceProfile.taskbarHeight + deviceProfile.getTaskbarOffsetY(); } mActivity.setTaskbarWindowSize(taskbarWindowSize); mTaskbarNavButtonTranslationY.updateValue(-deviceProfile.getTaskbarOffsetY()); } Loading Loading
quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java +2 −2 Original line number Diff line number Diff line Loading @@ -237,7 +237,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT DeviceProfile deviceProfile = mContext.getDeviceProfile(); Resources resources = mContext.getResources(); Point p = !mContext.isUserSetupComplete() ? new Point(0, mControllers.taskbarActivityContext.getSetupWindowHeight()) ? new Point(0, mControllers.taskbarActivityContext.getSetupWindowSize()) : DimensionUtils.getTaskbarPhoneDimensions(deviceProfile, resources, mContext.isPhoneMode()); mNavButtonsView.getLayoutParams().height = p.y; Loading Loading @@ -733,7 +733,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT navButtonsLayoutParams.setMarginEnd(0); navButtonsLayoutParams.gravity = Gravity.START; mNavButtonsView.getLayoutParams().height = mControllers.taskbarActivityContext.getSetupWindowHeight(); mControllers.taskbarActivityContext.getSetupWindowSize(); mNavButtonContainer.setLayoutParams(navButtonsLayoutParams); } Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +28 −19 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { private WindowManager.LayoutParams mWindowLayoutParams; private boolean mIsFullscreen; // The size we should return to when we call setTaskbarWindowFullscreen(false) private int mLastRequestedNonFullscreenHeight; private int mLastRequestedNonFullscreenSize; private NavigationMode mNavMode; private boolean mImeDrawsImeNavBar; Loading Loading @@ -364,7 +364,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { public void init(@NonNull TaskbarSharedState sharedState) { mImeDrawsImeNavBar = getBoolByName(IME_DRAWS_IME_NAV_BAR_RES_NAME, getResources(), false); mLastRequestedNonFullscreenHeight = getDefaultTaskbarWindowHeight(); mLastRequestedNonFullscreenSize = getDefaultTaskbarWindowSize(); mWindowLayoutParams = createAllWindowParams(); // Initialize controllers after all are constructed. Loading Loading @@ -485,7 +485,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { } WindowManager.LayoutParams windowLayoutParams = new WindowManager.LayoutParams( MATCH_PARENT, mLastRequestedNonFullscreenHeight, mLastRequestedNonFullscreenSize, type, windowFlags, PixelFormat.TRANSLUCENT); Loading Loading @@ -530,16 +530,16 @@ public class TaskbarActivityContext extends BaseTaskbarContext { case Surface.ROTATION_0, Surface.ROTATION_180 -> { // Defaults are fine width = WindowManager.LayoutParams.MATCH_PARENT; height = mLastRequestedNonFullscreenHeight; height = mLastRequestedNonFullscreenSize; gravity = Gravity.BOTTOM; } case Surface.ROTATION_90 -> { width = mLastRequestedNonFullscreenHeight; width = mLastRequestedNonFullscreenSize; height = WindowManager.LayoutParams.MATCH_PARENT; gravity = Gravity.END; } case Surface.ROTATION_270 -> { width = mLastRequestedNonFullscreenHeight; width = mLastRequestedNonFullscreenSize; height = WindowManager.LayoutParams.MATCH_PARENT; gravity = Gravity.START; } Loading @@ -564,7 +564,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { public void onConfigurationChanged(@Config int configChanges) { mControllers.onConfigurationChanged(configChanges); if (!mIsUserSetupComplete) { setTaskbarWindowHeight(getSetupWindowHeight()); setTaskbarWindowSize(getSetupWindowSize()); } } Loading Loading @@ -871,7 +871,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { public void setTaskbarWindowFullscreen(boolean fullscreen) { setAutohideSuspendFlag(FLAG_AUTOHIDE_SUSPEND_FULLSCREEN, fullscreen); mIsFullscreen = fullscreen; setTaskbarWindowHeight(fullscreen ? MATCH_PARENT : mLastRequestedNonFullscreenHeight); setTaskbarWindowSize(fullscreen ? MATCH_PARENT : mLastRequestedNonFullscreenSize); } /** Loading @@ -896,16 +896,20 @@ public class TaskbarActivityContext extends BaseTaskbarContext { } /** * Updates the TaskbarContainer height (pass {@link #getDefaultTaskbarWindowHeight()} to reset). * Updates the TaskbarContainer size (pass {@link #getDefaultTaskbarWindowSize()} to reset). */ public void setTaskbarWindowHeight(int height) { if (mWindowLayoutParams.height == height || mIsDestroyed) { public void setTaskbarWindowSize(int size) { // In landscape phone button nav mode, we should set the task bar width instead of height // because this is the only case in which the nav bar is not on the display bottom. boolean landscapePhoneButtonNav = isPhoneButtonNavMode() && mDeviceProfile.isLandscape; if ((landscapePhoneButtonNav ? mWindowLayoutParams.width : mWindowLayoutParams.height) == size || mIsDestroyed) { return; } if (height == MATCH_PARENT) { height = mDeviceProfile.heightPx; if (size == MATCH_PARENT) { size = mDeviceProfile.heightPx; } else { mLastRequestedNonFullscreenHeight = height; mLastRequestedNonFullscreenSize = size; if (mIsFullscreen) { // We still need to be fullscreen, so defer any change to our height until we call // setTaskbarWindowFullscreen(false). For example, this could happen when dragging Loading @@ -914,15 +918,20 @@ public class TaskbarActivityContext extends BaseTaskbarContext { return; } } mWindowLayoutParams.height = height; if (landscapePhoneButtonNav) { mWindowLayoutParams.width = size; } else { mWindowLayoutParams.height = size; } mControllers.taskbarInsetsController.onTaskbarOrBubblebarWindowHeightOrInsetsChanged(); notifyUpdateLayoutParams(); } /** * Returns the default height of the window, including the static corner radii above taskbar. * Returns the default size (in most cases height, but in 3-button phone mode, width) of the * window, including the static corner radii above taskbar. */ public int getDefaultTaskbarWindowHeight() { public int getDefaultTaskbarWindowSize() { Resources resources = getResources(); if (ENABLE_TASKBAR_NAVBAR_UNIFICATION && mDeviceProfile.isPhone) { Loading @@ -932,7 +941,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { } if (!isUserSetupComplete()) { return getSetupWindowHeight(); return getSetupWindowSize(); } boolean shouldTreatAsTransient = DisplayController.isTransientTaskbar(this) Loading Loading @@ -963,7 +972,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { + extraHeightForTaskbarTooltips; } public int getSetupWindowHeight() { public int getSetupWindowSize() { return getResources().getDimensionPixelSize(R.dimen.taskbar_suw_frame); } Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java +12 −4 Original line number Diff line number Diff line Loading @@ -684,9 +684,9 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar setter.addFloat(mThemedIconsBackgroundProgress, VALUE, 1f, 0f, LINEAR); } int collapsedHeight = mActivity.getDefaultTaskbarWindowHeight(); int collapsedHeight = mActivity.getDefaultTaskbarWindowSize(); int expandedHeight = Math.max(collapsedHeight, taskbarDp.taskbarHeight + offsetY); setter.addOnFrameListener(anim -> mActivity.setTaskbarWindowHeight( setter.addOnFrameListener(anim -> mActivity.setTaskbarWindowSize( anim.getAnimatedFraction() > 0 ? expandedHeight : collapsedHeight)); mTaskbarBottomMargin = isTransientTaskbar Loading Loading @@ -822,8 +822,16 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar // We only translate on rotation when icon is aligned with hotseat return; } mActivity.setTaskbarWindowHeight( deviceProfile.taskbarHeight + deviceProfile.getTaskbarOffsetY()); int taskbarWindowSize; if (mActivity.isPhoneMode()) { taskbarWindowSize = mActivity.getResources().getDimensionPixelSize( mActivity.isThreeButtonNav() ? R.dimen.taskbar_phone_size : R.dimen.taskbar_stashed_size); } else { taskbarWindowSize = deviceProfile.taskbarHeight + deviceProfile.getTaskbarOffsetY(); } mActivity.setTaskbarWindowSize(taskbarWindowSize); mTaskbarNavButtonTranslationY.updateValue(-deviceProfile.getTaskbarOffsetY()); } Loading