In 3-button landscape/seascape, override nav insets to always present
- In 3-button landscape/seascape, Launcher should always have nav insets regardless if it's initiated from fullscreen apps - This avoid inset to change mid-way during app->overview transition via recents button - This bug doesn't happen in portrait because bottomNav is always overriden in WindowManagerProxy, we're now applying the same fix in landscape/seascape Test: Recents button from fullscreen app in 3-button landscape/seascape, and launch adjacent fullscreen app in Overview Test: Homescreen and widget picker in 3-button landscape/seascape Fix: 316085856 Flag: None Change-Id: Ia4ae7948fe794b71c49f89c43dd2d1d14031abb9
This commit is contained in:
@@ -145,7 +145,18 @@ public class WindowManagerProxy implements ResourceBasedOverride {
|
||||
: (isGesture
|
||||
? getDimenByName(systemRes, NAVBAR_HEIGHT_LANDSCAPE)
|
||||
: 0));
|
||||
Insets newNavInsets = Insets.of(navInsets.left, navInsets.top, navInsets.right, bottomNav);
|
||||
int leftNav = navInsets.left;
|
||||
int rightNav = navInsets.right;
|
||||
if (!isLargeScreen && !isGesture && !isPortrait) {
|
||||
// In 3-button landscape/seascape, Launcher should always have nav insets regardless if
|
||||
// it's initiated from fullscreen apps.
|
||||
int navBarWidth = getDimenByName(systemRes, NAVBAR_LANDSCAPE_LEFT_RIGHT_SIZE);
|
||||
switch (getRotation(context)) {
|
||||
case Surface.ROTATION_90 -> rightNav = navBarWidth;
|
||||
case Surface.ROTATION_270 -> leftNav = navBarWidth;
|
||||
}
|
||||
}
|
||||
Insets newNavInsets = Insets.of(leftNav, navInsets.top, rightNav, bottomNav);
|
||||
insetsBuilder.setInsets(WindowInsets.Type.navigationBars(), newNavInsets);
|
||||
insetsBuilder.setInsetsIgnoringVisibility(WindowInsets.Type.navigationBars(), newNavInsets);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user