Add support for taskbar phone 3 button seascape

* Ignore orientation check from ag/22709055 for now,
that will be reverted. This causes recreateTaskbar() to
not run when folding the device

Bug: 274517647
Test: Tested 3 button nav in portrait/landscape/seascape
Flag: persist.wm.debug.hide_navbar_window
Change-Id: Ied02ead677d496b465c748257e32b7db5eb9580c
This commit is contained in:
Vinit Nayak
2023-04-13 14:01:34 -07:00
parent 1e3d799fe3
commit 15a9feb67f
13 changed files with 298 additions and 107 deletions

View File

@@ -88,6 +88,7 @@ import com.android.launcher3.taskbar.TaskbarNavButtonController.TaskbarButton;
import com.android.launcher3.taskbar.navbutton.NavButtonLayoutFactory;
import com.android.launcher3.taskbar.navbutton.NavButtonLayoutFactory.NavButtonLayoutter;
import com.android.launcher3.util.DimensionUtils;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.MultiPropertyFactory.MultiProperty;
import com.android.launcher3.util.MultiValueAlpha;
import com.android.launcher3.util.TouchController;
@@ -197,6 +198,7 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
this::onComputeInsetsForSeparateWindow;
private final RecentsHitboxExtender mHitboxExtender = new RecentsHitboxExtender();
private ImageView mRecentsButton;
private DisplayController mDisplayController;
public NavbarButtonsViewController(TaskbarActivityContext context, FrameLayout navButtonsView) {
mContext = context;
@@ -226,6 +228,8 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
TaskbarManager.isPhoneMode(deviceProfile));
mNavButtonsView.getLayoutParams().height = p.y;
mDisplayController = DisplayController.INSTANCE.get(mContext);
mIsImeRenderingNavButtons =
InputMethodService.canImeRenderGesturalNavButtons() && mContext.imeDrawsImeNavBar();
if (!mIsImeRenderingNavButtons) {
@@ -727,14 +731,10 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
boolean isInKidsMode = mContext.isNavBarKidsModeActive();
if (TaskbarManager.FLAG_HIDE_NAVBAR_WINDOW) {
if (!isThreeButtonNav) {
return;
}
NavButtonLayoutter navButtonLayoutter =
NavButtonLayoutFactory.Companion.getUiLayoutter(
dp, mNavButtonsView, res, isInKidsMode, isInSetup, isThreeButtonNav,
TaskbarManager.isPhoneMode(dp));
TaskbarManager.isPhoneMode(dp), mDisplayController.getInfo().rotation);
navButtonLayoutter.layoutButtons(dp, isContextualButtonShowing());
return;
}