Removing a 'percent' parameter for scroll
am: 83b03b08de
Change-Id: I7d082d145f211f984982d73fb3a81b8fde21fd19
This commit is contained in:
@@ -150,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")) {
|
||||
@@ -177,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();
|
||||
}
|
||||
}
|
||||
@@ -191,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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -789,7 +789,6 @@ public final class LauncherInstrumentation {
|
||||
scroll(
|
||||
container,
|
||||
Direction.DOWN,
|
||||
1f,
|
||||
new Rect(
|
||||
0,
|
||||
0,
|
||||
@@ -798,7 +797,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;
|
||||
@@ -816,7 +815,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);
|
||||
}
|
||||
@@ -824,7 +823,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);
|
||||
}
|
||||
@@ -832,7 +831,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);
|
||||
}
|
||||
@@ -840,7 +839,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);
|
||||
}
|
||||
|
||||
@@ -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")) {
|
||||
@@ -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")) {
|
||||
|
||||
@@ -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();
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user