Using different swipe length to switch to Overview.

Depends on whether swiping from Workspace or Background.

Change-Id: I0f647e85080ee1458a0f18cb132b87890379260e
This commit is contained in:
vadimt 2019-02-25 15:47:43 -08:00
parent 3ebf9deacb
commit a31f7eb68d
2 changed files with 10 additions and 1 deletions

View File

@ -62,7 +62,7 @@ public class Background extends LauncherInstrumentation.VisibleContainer {
final int height = mLauncher.getDevice().getDisplayHeight();
final UiObject2 navBar = mLauncher.getSystemUiObject("navigation_bar_frame");
int swipeLength = Math.round(100 * mLauncher.getDisplayDensity());
int swipeLength = Math.round(getSwipeLength() * mLauncher.getDisplayDensity());
mLauncher.swipe(
navBar.getVisibleBounds().centerX(), navBar.getVisibleBounds().centerY(),
navBar.getVisibleBounds().centerX(), height - swipeLength,
@ -71,4 +71,8 @@ public class Background extends LauncherInstrumentation.VisibleContainer {
mLauncher.getSystemUiObject("recent_apps").click();
}
}
protected int getSwipeLength() {
return 200;
}
}

View File

@ -160,4 +160,9 @@ public final class Workspace extends Home {
mLauncher.getDevice().pressKeyCode(KeyEvent.KEYCODE_W, KeyEvent.META_CTRL_ON);
return new Widgets(mLauncher);
}
@Override
protected int getSwipeLength() {
return 100;
}
}