Merge "Deprecating LauncherInstrumentation constructor with parameter" into ub-launcher3-qt-qpr1-dev
diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java
index f63612d..6dced8c 100644
--- a/tests/tapl/com/android/launcher3/tapl/AllApps.java
+++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java
@@ -150,7 +150,7 @@
"Exceeded max scroll attempts: " + MAX_SCROLL_ATTEMPTS,
++attempts <= MAX_SCROLL_ATTEMPTS);
- mLauncher.scroll(allAppsContainer, Direction.UP, 1, margins, 50);
+ mLauncher.scroll(allAppsContainer, Direction.UP, margins, 50);
}
try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer("scrolled up")) {
@@ -177,7 +177,7 @@
final UiObject2 allAppsContainer = verifyActiveContainer();
// Start the gesture in the center to avoid starting at elements near the top.
mLauncher.scroll(
- allAppsContainer, Direction.DOWN, 1, new Rect(0, 0, 0, mHeight / 2), 10);
+ allAppsContainer, Direction.DOWN, new Rect(0, 0, 0, mHeight / 2), 10);
verifyActiveContainer();
}
}
@@ -191,7 +191,7 @@
final UiObject2 allAppsContainer = verifyActiveContainer();
// Start the gesture in the center, for symmetry with forward.
mLauncher.scroll(
- allAppsContainer, Direction.UP, 1, new Rect(0, mHeight / 2, 0, 0), 10);
+ allAppsContainer, Direction.UP, new Rect(0, mHeight / 2, 0, 0), 10);
verifyActiveContainer();
}
}
diff --git a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
index 25e6e8c..49c0c89 100644
--- a/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
+++ b/tests/tapl/com/android/launcher3/tapl/BaseOverview.java
@@ -55,7 +55,7 @@
final int leftMargin = mLauncher.getTestInfo(
TestProtocol.REQUEST_OVERVIEW_LEFT_GESTURE_MARGIN).
getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD);
- mLauncher.scroll(overview, Direction.LEFT, 1, new Rect(leftMargin, 0, 0, 0), 20);
+ mLauncher.scroll(overview, Direction.LEFT, new Rect(leftMargin, 0, 0, 0), 20);
verifyActiveContainer();
}
}
@@ -93,7 +93,7 @@
final int rightMargin = mLauncher.getTestInfo(
TestProtocol.REQUEST_OVERVIEW_RIGHT_GESTURE_MARGIN).
getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD);
- mLauncher.scroll(overview, Direction.RIGHT, 1, new Rect(0, 0, rightMargin, 0), 20);
+ mLauncher.scroll(overview, Direction.RIGHT, new Rect(0, 0, rightMargin, 0), 20);
verifyActiveContainer();
}
}
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index 49d7c79..d89ec8b 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -799,7 +799,6 @@
scroll(
container,
Direction.DOWN,
- 1f,
new Rect(
0,
0,
@@ -808,7 +807,7 @@
150);
}
- void scroll(UiObject2 container, Direction direction, float percent, Rect margins, int steps) {
+ void scroll(UiObject2 container, Direction direction, Rect margins, int steps) {
final Rect rect = container.getVisibleBounds();
if (margins != null) {
rect.left += margins.left;
@@ -826,7 +825,7 @@
case UP: {
startX = endX = rect.centerX();
final int vertCenter = rect.centerY();
- final float halfGestureHeight = rect.height() * percent / 2.0f;
+ final float halfGestureHeight = rect.height() / 2.0f;
startY = (int) (vertCenter - halfGestureHeight) + 1;
endY = (int) (vertCenter + halfGestureHeight);
}
@@ -834,7 +833,7 @@
case DOWN: {
startX = endX = rect.centerX();
final int vertCenter = rect.centerY();
- final float halfGestureHeight = rect.height() * percent / 2.0f;
+ final float halfGestureHeight = rect.height() / 2.0f;
startY = (int) (vertCenter + halfGestureHeight) - 1;
endY = (int) (vertCenter - halfGestureHeight);
}
@@ -842,7 +841,7 @@
case LEFT: {
startY = endY = rect.centerY();
final int horizCenter = rect.centerX();
- final float halfGestureWidth = rect.width() * percent / 2.0f;
+ final float halfGestureWidth = rect.width() / 2.0f;
startX = (int) (horizCenter - halfGestureWidth) + 1;
endX = (int) (horizCenter + halfGestureWidth);
}
@@ -850,7 +849,7 @@
case RIGHT: {
startY = endY = rect.centerY();
final int horizCenter = rect.centerX();
- final float halfGestureWidth = rect.width() * percent / 2.0f;
+ final float halfGestureWidth = rect.width() / 2.0f;
startX = (int) (horizCenter + halfGestureWidth) - 1;
endX = (int) (horizCenter - halfGestureWidth);
}
diff --git a/tests/tapl/com/android/launcher3/tapl/Widgets.java b/tests/tapl/com/android/launcher3/tapl/Widgets.java
index aabcac2..51239c9 100644
--- a/tests/tapl/com/android/launcher3/tapl/Widgets.java
+++ b/tests/tapl/com/android/launcher3/tapl/Widgets.java
@@ -48,7 +48,6 @@
mLauncher.scroll(
widgetsContainer,
Direction.DOWN,
- 1f,
new Rect(0, 0, 0, mLauncher.getBottomGestureMargin(widgetsContainer)),
FLING_STEPS);
try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer("flung forward")) {
@@ -69,7 +68,6 @@
mLauncher.scroll(
widgetsContainer,
Direction.UP,
- 1f,
new Rect(0, 0, widgetsContainer.getVisibleBounds().width(), 0),
FLING_STEPS);
try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer("flung back")) {
diff --git a/tests/tapl/com/android/launcher3/tapl/Workspace.java b/tests/tapl/com/android/launcher3/tapl/Workspace.java
index da74b66..01edcc2 100644
--- a/tests/tapl/com/android/launcher3/tapl/Workspace.java
+++ b/tests/tapl/com/android/launcher3/tapl/Workspace.java
@@ -180,7 +180,7 @@
*/
public void flingForward() {
final UiObject2 workspace = verifyActiveContainer();
- mLauncher.scroll(workspace, Direction.RIGHT, 1f,
+ mLauncher.scroll(workspace, Direction.RIGHT,
new Rect(0, 0, mLauncher.getEdgeSensitivityWidth(), 0),
FLING_STEPS);
verifyActiveContainer();
@@ -192,7 +192,7 @@
*/
public void flingBackward() {
final UiObject2 workspace = verifyActiveContainer();
- mLauncher.scroll(workspace, Direction.LEFT, 1f,
+ mLauncher.scroll(workspace, Direction.LEFT,
new Rect(mLauncher.getEdgeSensitivityWidth(), 0, 0, 0),
FLING_STEPS);
verifyActiveContainer();