From b42265861b4dc372c177f5118364b7011a9c17c6 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Fri, 3 Sep 2021 16:33:35 -0700 Subject: [PATCH] Use max of corners when deciding gestures and add logs for corners Bug: 197326121 Test: Pre/postsubmit Change-Id: I1c083dc9234354f66cf1537f0cfe8c21f1e1be3b --- .../com/android/launcher3/tapl/LauncherInstrumentation.java | 4 +++- tests/tapl/com/android/launcher3/tapl/Workspace.java | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index e3f35e1f8c..98d081b70a 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -1561,6 +1561,7 @@ public final class LauncherInstrumentation { float getWindowCornerRadius() { final Resources resources = getResources(); if (!supportsRoundedCornersOnWindows(resources)) { + Log.d(TAG, "No rounded corners"); return 0f; } @@ -1579,7 +1580,8 @@ public final class LauncherInstrumentation { // Always use the smallest radius to make sure the rounded corners will // completely cover the display. - return Math.min(topRadius, bottomRadius); + Log.d(TAG, "Rounded corners top: " + topRadius + " bottom: " + bottomRadius); + return Math.max(topRadius, bottomRadius); } private static boolean supportsRoundedCornersOnWindows(Resources resources) { diff --git a/tests/tapl/com/android/launcher3/tapl/Workspace.java b/tests/tapl/com/android/launcher3/tapl/Workspace.java index db2e250bd3..288c85319b 100644 --- a/tests/tapl/com/android/launcher3/tapl/Workspace.java +++ b/tests/tapl/com/android/launcher3/tapl/Workspace.java @@ -83,9 +83,9 @@ public final class Workspace extends Home { + mLauncher.getTouchSlop()); mLauncher.swipeToState( - 0, + windowCornerRadius, startY, - 0, + windowCornerRadius, startY - swipeHeight - mLauncher.getTouchSlop(), 12, ALL_APPS_STATE_ORDINAL, LauncherInstrumentation.GestureScope.INSIDE);