Loading tests/tapl/com/android/launcher3/tapl/AllApps.java +3 −3 Original line number Diff line number Diff line Loading @@ -163,7 +163,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")) { Loading Loading @@ -191,7 +191,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(); } } Loading @@ -205,7 +205,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(); } } Loading tests/tapl/com/android/launcher3/tapl/BaseOverview.java +2 −2 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { 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(); } } Loading Loading @@ -89,7 +89,7 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { 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(); } } Loading tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +5 −6 Original line number Diff line number Diff line Loading @@ -780,7 +780,6 @@ public final class LauncherInstrumentation { scroll( container, Direction.DOWN, 1f, new Rect( 0, 0, Loading @@ -789,7 +788,7 @@ public final class LauncherInstrumentation { 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; Loading @@ -807,7 +806,7 @@ public final class LauncherInstrumentation { 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); } Loading @@ -815,7 +814,7 @@ public final class LauncherInstrumentation { 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); } Loading @@ -823,7 +822,7 @@ public final class LauncherInstrumentation { 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); } Loading @@ -831,7 +830,7 @@ public final class LauncherInstrumentation { 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); } Loading tests/tapl/com/android/launcher3/tapl/Widgets.java +0 −2 Original line number Diff line number Diff line Loading @@ -48,7 +48,6 @@ public final class Widgets extends LauncherInstrumentation.VisibleContainer { mLauncher.scroll( widgetsContainer, Direction.DOWN, 1f, new Rect(0, 0, 0, mLauncher.getBottomGestureMargin(widgetsContainer)), FLING_STEPS); try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer("flung forward")) { Loading @@ -69,7 +68,6 @@ public final class Widgets extends LauncherInstrumentation.VisibleContainer { mLauncher.scroll( widgetsContainer, Direction.UP, 1f, new Rect(0, 0, widgetsContainer.getVisibleBounds().width(), 0), FLING_STEPS); try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer("flung back")) { Loading tests/tapl/com/android/launcher3/tapl/Workspace.java +2 −2 Original line number Diff line number Diff line Loading @@ -181,7 +181,7 @@ public final class Workspace extends Home { */ 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(); Loading @@ -193,7 +193,7 @@ public final class Workspace extends Home { */ 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(); Loading Loading
tests/tapl/com/android/launcher3/tapl/AllApps.java +3 −3 Original line number Diff line number Diff line Loading @@ -163,7 +163,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")) { Loading Loading @@ -191,7 +191,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(); } } Loading @@ -205,7 +205,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(); } } Loading
tests/tapl/com/android/launcher3/tapl/BaseOverview.java +2 −2 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { 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(); } } Loading Loading @@ -89,7 +89,7 @@ public class BaseOverview extends LauncherInstrumentation.VisibleContainer { 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(); } } Loading
tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +5 −6 Original line number Diff line number Diff line Loading @@ -780,7 +780,6 @@ public final class LauncherInstrumentation { scroll( container, Direction.DOWN, 1f, new Rect( 0, 0, Loading @@ -789,7 +788,7 @@ public final class LauncherInstrumentation { 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; Loading @@ -807,7 +806,7 @@ public final class LauncherInstrumentation { 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); } Loading @@ -815,7 +814,7 @@ public final class LauncherInstrumentation { 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); } Loading @@ -823,7 +822,7 @@ public final class LauncherInstrumentation { 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); } Loading @@ -831,7 +830,7 @@ public final class LauncherInstrumentation { 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); } Loading
tests/tapl/com/android/launcher3/tapl/Widgets.java +0 −2 Original line number Diff line number Diff line Loading @@ -48,7 +48,6 @@ public final class Widgets extends LauncherInstrumentation.VisibleContainer { mLauncher.scroll( widgetsContainer, Direction.DOWN, 1f, new Rect(0, 0, 0, mLauncher.getBottomGestureMargin(widgetsContainer)), FLING_STEPS); try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer("flung forward")) { Loading @@ -69,7 +68,6 @@ public final class Widgets extends LauncherInstrumentation.VisibleContainer { mLauncher.scroll( widgetsContainer, Direction.UP, 1f, new Rect(0, 0, widgetsContainer.getVisibleBounds().width(), 0), FLING_STEPS); try (LauncherInstrumentation.Closable c1 = mLauncher.addContextLayer("flung back")) { Loading
tests/tapl/com/android/launcher3/tapl/Workspace.java +2 −2 Original line number Diff line number Diff line Loading @@ -181,7 +181,7 @@ public final class Workspace extends Home { */ 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(); Loading @@ -193,7 +193,7 @@ public final class Workspace extends Home { */ 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(); Loading