Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5e0f43a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Slowing down workspace test fling" into ub-launcher3-master

parents 2bed8724 06344e79
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -424,4 +424,8 @@ public final class LauncherInstrumentation {
        mInstrumentation.sendPointerSync(event);
        event.recycle();
    }

    float getDisplayDensity() {
        return mInstrumentation.getTargetContext().getResources().getDisplayMetrics().density;
    }
}
 No newline at end of file
+3 −2
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import androidx.test.uiautomator.UiObject2;
 * Operations on the workspace screen.
 */
public final class Workspace extends Home {
    private static final float FLING_SPEED = 3500.0F;
    private final UiObject2 mHotseat;
    private final int ICON_DRAG_SPEED = 2000;

@@ -124,7 +125,7 @@ public final class Workspace extends Home {
     */
    public void flingForward() {
        final UiObject2 workspace = verifyActiveContainer();
        workspace.fling(Direction.RIGHT);
        workspace.fling(Direction.RIGHT, (int) (FLING_SPEED * mLauncher.getDisplayDensity()));
        mLauncher.waitForIdle();
        verifyActiveContainer();
    }
@@ -135,7 +136,7 @@ public final class Workspace extends Home {
     */
    public void flingBackward() {
        final UiObject2 workspace = verifyActiveContainer();
        workspace.fling(Direction.LEFT);
        workspace.fling(Direction.LEFT, (int) (FLING_SPEED * mLauncher.getDisplayDensity()));
        mLauncher.waitForIdle();
        verifyActiveContainer();
    }