Don't apply left/right inset on gesture nav landscape

Fix: 201775630
Test: Go to landscape with gesture nav, widgets not cropped and cellSize matches HSV
Change-Id: I68e62897b31dbb8509c95a20e8d3a3528a40fe9b
This commit is contained in:
Alex Chau
2021-10-12 15:52:36 +01:00
parent e202a64e56
commit bbe6cf30a2
2 changed files with 9 additions and 4 deletions

View File

@@ -60,10 +60,10 @@ public class WindowManagerCompat {
}
WindowInsets defaultInsets = windowContext.getSystemService(WindowManager.class)
.getMaximumWindowMetrics().getWindowInsets();
boolean hasNavbar = ResourceUtils.getIntegerByName(
boolean isGesturalMode = ResourceUtils.getIntegerByName(
"config_navBarInteractionMode",
windowContext.getResources(),
INVALID_RESOURCE_HANDLE) != 0;
INVALID_RESOURCE_HANDLE) == 2;
WindowInsets.Builder insetsBuilder = new WindowInsets.Builder(defaultInsets);
Set<WindowBounds> result = new ArraySet<>();
@@ -74,7 +74,7 @@ public class WindowManagerCompat {
if (isTablet && !consumeTaskBar) {
portraitNav = landscapeNav = Insets.of(0, 0, 0, windowContext.getResources()
.getDimensionPixelSize(R.dimen.taskbar_size));
} else if (hasNavbar) {
} else if (!isGesturalMode) {
portraitNav = Insets.of(0, 0, 0,
getSystemResource(windowContext, "navigation_bar_height", swDP));
landscapeNav = isTablet