Merge "Don't apply left/right inset on gesture nav landscape" into sc-v2-dev am: abf9850dea

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16034083

Change-Id: I9e37905f0d27c04a7368d0ca38a73181d21865ee
This commit is contained in:
Alex Chau
2021-10-19 10:41:33 +00:00
committed by Automerger Merge Worker
2 changed files with 9 additions and 4 deletions
@@ -1,5 +1,6 @@
package com.android.launcher3;
import static com.android.launcher3.ResourceUtils.INVALID_RESOURCE_HANDLE;
import static com.android.launcher3.config.FeatureFlags.SEPARATE_RECENTS_ACTIVITY;
import android.annotation.TargetApi;
@@ -99,7 +100,11 @@ public class LauncherRootView extends InsettableFrameLayout {
oldNavInsets.bottom);
if (dp.isLandscape) {
if (dp.isTablet) {
boolean isGesturalMode = ResourceUtils.getIntegerByName(
"config_navBarInteractionMode",
resources,
INVALID_RESOURCE_HANDLE) == 2;
if (dp.isTablet || isGesturalMode) {
newNavInsets.bottom = ResourceUtils.getNavbarSize(
"navigation_bar_height_landscape", resources);
} else {
@@ -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