Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bbe6cf30 authored by Alex Chau's avatar Alex Chau
Browse files

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
parent e202a64e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
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 {
+3 −3
Original line number Diff line number Diff line
@@ -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