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

Commit 6d862386 authored by Vadim Tryshev's avatar Vadim Tryshev Committed by vadimt
Browse files

Slowing down some gestures for testing on virtual devices

Change-Id: Ie8b9a4eff3e9b4c133719a6292d2d251b87b90e8
parent 56635d4f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ import com.android.launcher3.TestProtocol;
public class AllApps extends LauncherInstrumentation.VisibleContainer {
    private static final int MAX_SCROLL_ATTEMPTS = 40;
    private static final int MIN_INTERACT_SIZE = 100;
    private static final int FLING_SPEED = 3000;
    private static final int FLING_SPEED = LauncherInstrumentation.needSlowGestures() ? 1000 : 3000;

    private final int mHeight;

+5 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.content.ContentResolver;
import android.content.Context;
import android.graphics.Point;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.os.SystemClock;
@@ -161,6 +162,10 @@ public final class LauncherInstrumentation {
        return isSwipeUpEnabled() ? NavigationModel.TWO_BUTTON : NavigationModel.THREE_BUTTON;
    }

    static boolean needSlowGestures() {
        return Build.MODEL.contains("Cuttlefish");
    }

    private boolean isSwipeUpEnabled() {
        final boolean swipeUpEnabledDefaultValue = SwipeUpSetting.isSwipeUpEnabledDefaultValue();
        return SwipeUpSetting.isSwipeUpSettingAvailable() ?
+2 −2
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ import com.android.launcher3.TestProtocol;
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;
    private final int ICON_DRAG_SPEED = LauncherInstrumentation.needSlowGestures() ? 100 : 570;

    Workspace(LauncherInstrumentation launcher) {
        super(launcher);
@@ -107,7 +107,7 @@ public final class Workspace extends Home {
                    getHotseatAppIcon("Messages"),
                    new Point(mLauncher.getDevice().getDisplayWidth(),
                            workspace.getVisibleBounds().centerY()),
                    ICON_DRAG_SPEED);
                    (int) (ICON_DRAG_SPEED * mLauncher.getDisplayDensity()));
            verifyActiveContainer();
        }
        assertTrue("Home screen workspace didn't become scrollable",