Loading quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java +6 −9 Original line number Diff line number Diff line Loading @@ -25,8 +25,6 @@ import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X; import static com.android.launcher3.Utilities.getDescendantCoordRelativeToAncestor; 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; Loading Loading @@ -239,7 +237,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT Point p = !mContext.isUserSetupComplete() ? new Point(0, mControllers.taskbarActivityContext.getSetupWindowHeight()) : DimensionUtils.getTaskbarPhoneDimensions(deviceProfile, resources, TaskbarManager.isPhoneMode(deviceProfile)); mContext.isPhoneMode()); mNavButtonsView.getLayoutParams().height = p.y; mIsImeRenderingNavButtons = Loading Loading @@ -305,7 +303,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT initButtons(mNavButtonContainer, mEndContextualContainer, mControllers.navButtonController); updateButtonLayoutSpacing(); updateStateForFlag(FLAG_SMALL_SCREEN, isPhoneButtonNavMode(mContext)); updateStateForFlag(FLAG_SMALL_SCREEN, mContext.isPhoneButtonNavMode()); mPropertyHolders.add(new StatePropertyHolder( mControllers.taskbarDragLayerController.getNavbarBackgroundAlpha(), Loading Loading @@ -388,7 +386,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT int navButtonSize = mContext.getResources().getDimensionPixelSize( R.dimen.taskbar_nav_buttons_size); boolean isRtl = Utilities.isRtl(mContext.getResources()); if (!isPhoneMode(mContext.getDeviceProfile())) { if (!mContext.isPhoneMode()) { mPropertyHolders.add(new StatePropertyHolder( mBackButton, flags -> (flags & FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE) != 0 || (flags & FLAG_KEYGUARD_VISIBLE) != 0, Loading Loading @@ -632,7 +630,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT * Sets the translationY of the nav buttons based on the current device state. */ public void updateNavButtonTranslationY() { if (isPhoneButtonNavMode(mContext)) { if (mContext.isPhoneButtonNavMode()) { return; } final float normalTranslationY = mTaskbarNavButtonTranslationY.value; Loading Loading @@ -751,9 +749,8 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT dp, mNavButtonsView, mImeSwitcherButton, mControllers.rotationButtonController.getRotationButton(), mA11yButton, res, isInKidsMode, isInSetup, isThreeButtonNav, TaskbarManager.isPhoneMode(dp), mWindowManagerProxy.getRotation(mContext)); navButtonLayoutter.layoutButtons(dp, isA11yButtonPersistent()); mContext.isPhoneMode(), mWindowManagerProxy.getRotation(mContext)); navButtonLayoutter.layoutButtons(mContext, isA11yButtonPersistent()); updateNavButtonColor(); return; } Loading quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java +3 −7 Original line number Diff line number Diff line Loading @@ -107,7 +107,7 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT mControllers = controllers; DeviceProfile deviceProfile = mActivity.getDeviceProfile(); Resources resources = mActivity.getResources(); if (isPhoneGestureNavMode(mActivity.getDeviceProfile())) { if (mActivity.isPhoneGestureNavMode()) { mTaskbarSize = resources.getDimensionPixelSize(R.dimen.taskbar_phone_size); mStashedHandleWidth = resources.getDimensionPixelSize(R.dimen.taskbar_stashed_small_screen); Loading @@ -120,7 +120,7 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT mStashedHandleView.getLayoutParams().height = mTaskbarSize + taskbarBottomMargin; mTaskbarStashedHandleAlpha.get(ALPHA_INDEX_STASHED).setValue( isPhoneGestureNavMode(deviceProfile) ? 1 : 0); mActivity.isPhoneGestureNavMode() ? 1 : 0); mTaskbarStashedHandleHintScale.updateValue(1f); final int stashedTaskbarHeight = mControllers.taskbarStashController.getStashedHeight(); Loading Loading @@ -148,7 +148,7 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT view.setPivotY(stashedCenterY); }); initRegionSampler(); if (isPhoneGestureNavMode(deviceProfile)) { if (mActivity.isPhoneGestureNavMode()) { onIsStashedChanged(true); } } Loading Loading @@ -184,10 +184,6 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT mRegionSamplingHelper = null; } private boolean isPhoneGestureNavMode(DeviceProfile deviceProfile) { return TaskbarManager.isPhoneMode(deviceProfile) && !mActivity.isThreeButtonNav(); } public MultiPropertyFactory<View> getStashedHandleAlpha() { return mTaskbarStashedHandleAlpha; } Loading quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +25 −6 Original line number Diff line number Diff line Loading @@ -214,7 +214,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { Context c = getApplicationContext(); mWindowManager = c.getSystemService(WindowManager.class); boolean phoneMode = TaskbarManager.isPhoneMode(mDeviceProfile); boolean phoneMode = isPhoneMode(); mLeftCorner = phoneMode ? null : display.getRoundedCorner(RoundedCorner.POSITION_BOTTOM_LEFT); Loading Loading @@ -387,6 +387,28 @@ public class TaskbarActivityContext extends BaseTaskbarContext { } } /** * @return {@code true} if the device profile isn't a large screen profile and we are using a * single window for taskbar and navbar. */ public boolean isPhoneMode() { return ENABLE_TASKBAR_NAVBAR_UNIFICATION && mDeviceProfile.isPhone; } /** * @return {@code true} if {@link #isPhoneMode()} is true and we're using 3 button-nav */ public boolean isPhoneButtonNavMode() { return isPhoneMode() && isThreeButtonNav(); } /** * @return {@code true} if {@link #isPhoneMode()} is true and we're using gesture nav */ public boolean isPhoneGestureNavMode() { return isPhoneMode() && !isThreeButtonNav(); } /** * Show Taskbar upon receiving broadcast */ Loading Loading @@ -464,9 +486,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { windowLayoutParams.privateFlags = WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION; windowLayoutParams.accessibilityTitle = getString( TaskbarManager.isPhoneMode(mDeviceProfile) ? R.string.taskbar_phone_a11y_title : R.string.taskbar_a11y_title); isPhoneMode() ? R.string.taskbar_phone_a11y_title : R.string.taskbar_a11y_title); return windowLayoutParams; } Loading @@ -480,8 +500,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { ENABLE_TASKBAR_NAVBAR_UNIFICATION ? TYPE_NAVIGATION_BAR : TYPE_NAVIGATION_BAR_PANEL; WindowManager.LayoutParams windowLayoutParams = createDefaultWindowLayoutParams(windowType, TaskbarActivityContext.WINDOW_TITLE); boolean isPhoneNavMode = TaskbarManager.isPhoneButtonNavMode(this); if (!isPhoneNavMode) { if (!isPhoneButtonNavMode()) { return windowLayoutParams; } Loading quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt +2 −3 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.graphics.Paint import android.graphics.Path import android.graphics.RectF import com.android.app.animation.Interpolators import com.android.launcher3.DeviceProfile import com.android.launcher3.R import com.android.launcher3.Utilities import com.android.launcher3.Utilities.mapRange Loading Loading @@ -95,10 +94,10 @@ class TaskbarBackgroundRenderer(private val context: TaskbarActivityContext) { setCornerRoundness(DEFAULT_ROUNDNESS) } fun updateStashedHandleWidth(dp: DeviceProfile, res: Resources) { fun updateStashedHandleWidth(context: TaskbarActivityContext, res: Resources) { stashedHandleWidth = res.getDimensionPixelSize( if (TaskbarManager.isPhoneMode(dp)) R.dimen.taskbar_stashed_small_screen if (context.isPhoneMode) R.dimen.taskbar_stashed_small_screen else R.dimen.taskbar_stashed_handle_width ) } Loading quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java +1 −1 Original line number Diff line number Diff line Loading @@ -106,7 +106,7 @@ public class TaskbarDragLayer extends BaseDragLayer<TaskbarActivityContext> { public void init(TaskbarDragLayerController.TaskbarDragLayerCallbacks callbacks) { mControllerCallbacks = callbacks; mBackgroundRenderer.updateStashedHandleWidth(mActivity.getDeviceProfile(), getResources()); mBackgroundRenderer.updateStashedHandleWidth(mActivity, getResources()); recreateControllers(); } Loading Loading
quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java +6 −9 Original line number Diff line number Diff line Loading @@ -25,8 +25,6 @@ import static com.android.launcher3.LauncherAnimUtils.VIEW_TRANSLATE_X; import static com.android.launcher3.Utilities.getDescendantCoordRelativeToAncestor; 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; Loading Loading @@ -239,7 +237,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT Point p = !mContext.isUserSetupComplete() ? new Point(0, mControllers.taskbarActivityContext.getSetupWindowHeight()) : DimensionUtils.getTaskbarPhoneDimensions(deviceProfile, resources, TaskbarManager.isPhoneMode(deviceProfile)); mContext.isPhoneMode()); mNavButtonsView.getLayoutParams().height = p.y; mIsImeRenderingNavButtons = Loading Loading @@ -305,7 +303,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT initButtons(mNavButtonContainer, mEndContextualContainer, mControllers.navButtonController); updateButtonLayoutSpacing(); updateStateForFlag(FLAG_SMALL_SCREEN, isPhoneButtonNavMode(mContext)); updateStateForFlag(FLAG_SMALL_SCREEN, mContext.isPhoneButtonNavMode()); mPropertyHolders.add(new StatePropertyHolder( mControllers.taskbarDragLayerController.getNavbarBackgroundAlpha(), Loading Loading @@ -388,7 +386,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT int navButtonSize = mContext.getResources().getDimensionPixelSize( R.dimen.taskbar_nav_buttons_size); boolean isRtl = Utilities.isRtl(mContext.getResources()); if (!isPhoneMode(mContext.getDeviceProfile())) { if (!mContext.isPhoneMode()) { mPropertyHolders.add(new StatePropertyHolder( mBackButton, flags -> (flags & FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE) != 0 || (flags & FLAG_KEYGUARD_VISIBLE) != 0, Loading Loading @@ -632,7 +630,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT * Sets the translationY of the nav buttons based on the current device state. */ public void updateNavButtonTranslationY() { if (isPhoneButtonNavMode(mContext)) { if (mContext.isPhoneButtonNavMode()) { return; } final float normalTranslationY = mTaskbarNavButtonTranslationY.value; Loading Loading @@ -751,9 +749,8 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT dp, mNavButtonsView, mImeSwitcherButton, mControllers.rotationButtonController.getRotationButton(), mA11yButton, res, isInKidsMode, isInSetup, isThreeButtonNav, TaskbarManager.isPhoneMode(dp), mWindowManagerProxy.getRotation(mContext)); navButtonLayoutter.layoutButtons(dp, isA11yButtonPersistent()); mContext.isPhoneMode(), mWindowManagerProxy.getRotation(mContext)); navButtonLayoutter.layoutButtons(mContext, isA11yButtonPersistent()); updateNavButtonColor(); return; } Loading
quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java +3 −7 Original line number Diff line number Diff line Loading @@ -107,7 +107,7 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT mControllers = controllers; DeviceProfile deviceProfile = mActivity.getDeviceProfile(); Resources resources = mActivity.getResources(); if (isPhoneGestureNavMode(mActivity.getDeviceProfile())) { if (mActivity.isPhoneGestureNavMode()) { mTaskbarSize = resources.getDimensionPixelSize(R.dimen.taskbar_phone_size); mStashedHandleWidth = resources.getDimensionPixelSize(R.dimen.taskbar_stashed_small_screen); Loading @@ -120,7 +120,7 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT mStashedHandleView.getLayoutParams().height = mTaskbarSize + taskbarBottomMargin; mTaskbarStashedHandleAlpha.get(ALPHA_INDEX_STASHED).setValue( isPhoneGestureNavMode(deviceProfile) ? 1 : 0); mActivity.isPhoneGestureNavMode() ? 1 : 0); mTaskbarStashedHandleHintScale.updateValue(1f); final int stashedTaskbarHeight = mControllers.taskbarStashController.getStashedHeight(); Loading Loading @@ -148,7 +148,7 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT view.setPivotY(stashedCenterY); }); initRegionSampler(); if (isPhoneGestureNavMode(deviceProfile)) { if (mActivity.isPhoneGestureNavMode()) { onIsStashedChanged(true); } } Loading Loading @@ -184,10 +184,6 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT mRegionSamplingHelper = null; } private boolean isPhoneGestureNavMode(DeviceProfile deviceProfile) { return TaskbarManager.isPhoneMode(deviceProfile) && !mActivity.isThreeButtonNav(); } public MultiPropertyFactory<View> getStashedHandleAlpha() { return mTaskbarStashedHandleAlpha; } Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +25 −6 Original line number Diff line number Diff line Loading @@ -214,7 +214,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { Context c = getApplicationContext(); mWindowManager = c.getSystemService(WindowManager.class); boolean phoneMode = TaskbarManager.isPhoneMode(mDeviceProfile); boolean phoneMode = isPhoneMode(); mLeftCorner = phoneMode ? null : display.getRoundedCorner(RoundedCorner.POSITION_BOTTOM_LEFT); Loading Loading @@ -387,6 +387,28 @@ public class TaskbarActivityContext extends BaseTaskbarContext { } } /** * @return {@code true} if the device profile isn't a large screen profile and we are using a * single window for taskbar and navbar. */ public boolean isPhoneMode() { return ENABLE_TASKBAR_NAVBAR_UNIFICATION && mDeviceProfile.isPhone; } /** * @return {@code true} if {@link #isPhoneMode()} is true and we're using 3 button-nav */ public boolean isPhoneButtonNavMode() { return isPhoneMode() && isThreeButtonNav(); } /** * @return {@code true} if {@link #isPhoneMode()} is true and we're using gesture nav */ public boolean isPhoneGestureNavMode() { return isPhoneMode() && !isThreeButtonNav(); } /** * Show Taskbar upon receiving broadcast */ Loading Loading @@ -464,9 +486,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { windowLayoutParams.privateFlags = WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION; windowLayoutParams.accessibilityTitle = getString( TaskbarManager.isPhoneMode(mDeviceProfile) ? R.string.taskbar_phone_a11y_title : R.string.taskbar_a11y_title); isPhoneMode() ? R.string.taskbar_phone_a11y_title : R.string.taskbar_a11y_title); return windowLayoutParams; } Loading @@ -480,8 +500,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext { ENABLE_TASKBAR_NAVBAR_UNIFICATION ? TYPE_NAVIGATION_BAR : TYPE_NAVIGATION_BAR_PANEL; WindowManager.LayoutParams windowLayoutParams = createDefaultWindowLayoutParams(windowType, TaskbarActivityContext.WINDOW_TITLE); boolean isPhoneNavMode = TaskbarManager.isPhoneButtonNavMode(this); if (!isPhoneNavMode) { if (!isPhoneButtonNavMode()) { return windowLayoutParams; } Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt +2 −3 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import android.graphics.Paint import android.graphics.Path import android.graphics.RectF import com.android.app.animation.Interpolators import com.android.launcher3.DeviceProfile import com.android.launcher3.R import com.android.launcher3.Utilities import com.android.launcher3.Utilities.mapRange Loading Loading @@ -95,10 +94,10 @@ class TaskbarBackgroundRenderer(private val context: TaskbarActivityContext) { setCornerRoundness(DEFAULT_ROUNDNESS) } fun updateStashedHandleWidth(dp: DeviceProfile, res: Resources) { fun updateStashedHandleWidth(context: TaskbarActivityContext, res: Resources) { stashedHandleWidth = res.getDimensionPixelSize( if (TaskbarManager.isPhoneMode(dp)) R.dimen.taskbar_stashed_small_screen if (context.isPhoneMode) R.dimen.taskbar_stashed_small_screen else R.dimen.taskbar_stashed_handle_width ) } Loading
quickstep/src/com/android/launcher3/taskbar/TaskbarDragLayer.java +1 −1 Original line number Diff line number Diff line Loading @@ -106,7 +106,7 @@ public class TaskbarDragLayer extends BaseDragLayer<TaskbarActivityContext> { public void init(TaskbarDragLayerController.TaskbarDragLayerCallbacks callbacks) { mControllerCallbacks = callbacks; mBackgroundRenderer.updateStashedHandleWidth(mActivity.getDeviceProfile(), getResources()); mBackgroundRenderer.updateStashedHandleWidth(mActivity, getResources()); recreateControllers(); } Loading