diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java index 0fd74bb26e..0c997dd598 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java @@ -331,21 +331,29 @@ public class TouchInteractionService extends Service implements defaultDisplay.getRealSize(realSize); mSwipeTouchRegion.set(0, 0, realSize.x, realSize.y); if (mMode == Mode.NO_BUTTON) { - mSwipeTouchRegion.top = mSwipeTouchRegion.bottom - getNavbarSize( - ResourceUtils.NAVBAR_VERTICAL_SIZE); + switch (defaultDisplay.getRotation()) { + case Surface.ROTATION_90: + case Surface.ROTATION_270: + mSwipeTouchRegion.top = mSwipeTouchRegion.bottom - getNavbarSize( + ResourceUtils.NAVBAR_LANDSCAPE_BOTTOM_SIZE); + break; + default: + mSwipeTouchRegion.top = mSwipeTouchRegion.bottom - getNavbarSize( + ResourceUtils.NAVBAR_PORTRAIT_BOTTOM_SIZE); + } } else { switch (defaultDisplay.getRotation()) { case Surface.ROTATION_90: mSwipeTouchRegion.left = mSwipeTouchRegion.right - - getNavbarSize(ResourceUtils.NAVBAR_HORIZONTAL_SIZE); + - getNavbarSize(ResourceUtils.NAVBAR_LANDSCAPE_LEFT_RIGHT_SIZE); break; case Surface.ROTATION_270: mSwipeTouchRegion.right = mSwipeTouchRegion.left - + getNavbarSize(ResourceUtils.NAVBAR_HORIZONTAL_SIZE); + + getNavbarSize(ResourceUtils.NAVBAR_LANDSCAPE_LEFT_RIGHT_SIZE); break; default: mSwipeTouchRegion.top = mSwipeTouchRegion.bottom - - getNavbarSize(ResourceUtils.NAVBAR_VERTICAL_SIZE); + - getNavbarSize(ResourceUtils.NAVBAR_PORTRAIT_BOTTOM_SIZE); } } } diff --git a/src/com/android/launcher3/ResourceUtils.java b/src/com/android/launcher3/ResourceUtils.java index 8df3290fd0..0c80d130ea 100644 --- a/src/com/android/launcher3/ResourceUtils.java +++ b/src/com/android/launcher3/ResourceUtils.java @@ -21,8 +21,10 @@ import android.util.DisplayMetrics; import android.util.TypedValue; public class ResourceUtils { - public static final String NAVBAR_VERTICAL_SIZE = "navigation_bar_frame_height"; - public static final String NAVBAR_HORIZONTAL_SIZE = "navigation_bar_width"; + public static final String NAVBAR_PORTRAIT_BOTTOM_SIZE = "navigation_bar_frame_height"; + public static final String NAVBAR_LANDSCAPE_LEFT_RIGHT_SIZE = "navigation_bar_width"; + public static final String NAVBAR_LANDSCAPE_BOTTOM_SIZE + = "navigation_bar_frame_height_landscape"; public static int getNavbarSize(String resName, Resources res) { return getDimenByName(resName, res, 48); diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java index ca6d968cc1..74cece836c 100644 --- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java @@ -243,7 +243,7 @@ public abstract class AbstractLauncherUiTest { */ protected UiObject2 scrollAndFind(UiObject2 container, BySelector condition) { final int margin = ResourceUtils.getNavbarSize( - ResourceUtils.NAVBAR_VERTICAL_SIZE, mLauncher.getResources()) + 1; + ResourceUtils.NAVBAR_PORTRAIT_BOTTOM_SIZE, mLauncher.getResources()) + 1; container.setGestureMargins(0, 0, 0, margin); int i = 0; diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java index a296975c3c..096a1d8cc3 100644 --- a/tests/tapl/com/android/launcher3/tapl/AllApps.java +++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java @@ -69,7 +69,7 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer { "want to get app icon on all apps")) { final UiObject2 allAppsContainer = verifyActiveContainer(); allAppsContainer.setGestureMargins(0, 0, 0, - ResourceUtils.getNavbarSize(ResourceUtils.NAVBAR_VERTICAL_SIZE, + ResourceUtils.getNavbarSize(ResourceUtils.NAVBAR_PORTRAIT_BOTTOM_SIZE, mLauncher.getResources()) + 1); final BySelector appIconSelector = AppIcon.getAppIconSelector(appName, mLauncher); if (!hasClickableIcon(allAppsContainer, appIconSelector)) { diff --git a/tests/tapl/com/android/launcher3/tapl/Widgets.java b/tests/tapl/com/android/launcher3/tapl/Widgets.java index f7e0b6c4e8..b780df4adb 100644 --- a/tests/tapl/com/android/launcher3/tapl/Widgets.java +++ b/tests/tapl/com/android/launcher3/tapl/Widgets.java @@ -41,7 +41,7 @@ public final class Widgets extends LauncherInstrumentation.VisibleContainer { LauncherInstrumentation.log("Widgets.flingForward enter"); final UiObject2 widgetsContainer = verifyActiveContainer(); widgetsContainer.setGestureMargins(0, 0, 0, - ResourceUtils.getNavbarSize(ResourceUtils.NAVBAR_VERTICAL_SIZE, + ResourceUtils.getNavbarSize(ResourceUtils.NAVBAR_PORTRAIT_BOTTOM_SIZE, mLauncher.getResources()) + 1); widgetsContainer.fling(Direction.DOWN, (int) (FLING_SPEED * mLauncher.getDisplayDensity()));