diff options
Diffstat (limited to 'tests/tapl/com/android/launcher3/tapl/AllApps.java')
-rw-r--r-- | tests/tapl/com/android/launcher3/tapl/AllApps.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java index f070280ea..6dced8c8c 100644 --- a/tests/tapl/com/android/launcher3/tapl/AllApps.java +++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java @@ -90,6 +90,7 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer { final UiObject2 allAppsContainer = verifyActiveContainer(); final UiObject2 appListRecycler = mLauncher.waitForObjectInContainer(allAppsContainer, "apps_list_view"); + final UiObject2 searchBox = getSearchBox(allAppsContainer); allAppsContainer.setGestureMargins( 0, getSearchBox(allAppsContainer).getVisibleBounds().bottom + 1, @@ -103,7 +104,11 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer { int scroll = getScroll(allAppsContainer); try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer("scrolled")) { while (!hasClickableIcon(allAppsContainer, appListRecycler, appIconSelector)) { - mLauncher.scroll(allAppsContainer, Direction.DOWN, 0.8f, null, 50); + mLauncher.scrollToLastVisibleRow( + allAppsContainer, + mLauncher.getObjectsInContainer(allAppsContainer, "icon"), + searchBox.getVisibleBounds().bottom - + allAppsContainer.getVisibleBounds().top); final int newScroll = getScroll(allAppsContainer); if (newScroll == scroll) break; @@ -145,7 +150,7 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer { "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")) { @@ -172,7 +177,7 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer { 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(); } } @@ -186,7 +191,7 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer { 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(); } } |