Sha256: 22281c9422cb0fec0d37a935179ddb954a254b18c564a38dfc1989a595a30eeb

Contents?: true

Size: 1.08 KB

Versions: 33

Compression:

Stored size: 1.08 KB

Contents

package sh.calaba.instrumentationbackend.actions.gestures;

import android.util.DisplayMetrics;
import sh.calaba.instrumentationbackend.InstrumentationBackend;
import sh.calaba.instrumentationbackend.Result;
import sh.calaba.instrumentationbackend.actions.Action;

import com.jayway.android.robotium.solo.Solo;

public class Swipe implements Action {

    @Override
    public Result execute(String... args) {
        String direction = args[0];

        if (args.length == 1) {
            if(direction.equalsIgnoreCase("left")) {
                InstrumentationBackend.solo.scrollToSide(Solo.LEFT);
                return Result.successResult();
            } else if(direction.equalsIgnoreCase("right")) {
                InstrumentationBackend.solo.scrollToSide(Solo.RIGHT);
                return Result.successResult();
            }
            return Result.failedResult("Invalid direction to swipe: " + direction);
        }
        return Result.failedResult("You must provide a direction. Either 'left' or 'right'");
    }

    @Override
    public String key() {
        return "swipe";
    }

}

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
testautoa-0.4.5 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.7.pre4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.7.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.7.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.7.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
testautoa-0.4.4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.6 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.5 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.5.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
testautoa-0.4.3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
testautoa-0.4.2.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.3.pre8 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.3.pre7 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.3.pre6 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.3.pre5 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.3.pre4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
calabash-android-0.4.3.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java
testautoa-0.4.2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/gestures/Swipe.java