package com.lukekorth.deviceautomator;

import android.support.test.uiautomator.UiObject;
import android.support.test.uiautomator.UiObjectNotFoundException;import java.lang.Override;import java.lang.RuntimeException;import java.lang.String;

/**
 * A collection of actions for use with {@link DeviceAutomator}.
 */
public abstract class AutomatorAction {

    /**
     * Performs a click on the ui element specified in
     * {@link DeviceAutomator#onDevice(UiObjectMatcher)}.
     *
     * @return
     */
    public static AutomatorAction click() {
        return new AutomatorAction() {
            @Override
            void wrappedPerform(UiObject object) throws UiObjectNotFoundException {
                object.click();
            }
        };
    }

    /**
     * Sets the text on the ui element specified in
     * {@link DeviceAutomator#onDevice(UiObjectMatcher)}.
     *
     * @return
     */
    public static AutomatorAction setText(final String text) {
        return new AutomatorAction() {
            @Override
            void wrappedPerform(UiObject object) throws UiObjectNotFoundException {
                object.setText(text);
            }
        };
    }

    /**
     * Clears the text field on the ui element specified in
     * {@link DeviceAutomator#onDevice(UiObjectMatcher)}.
     *
     * @return
     */
    public static AutomatorAction clearTextField() {
        return new AutomatorAction() {
            @Override
            void wrappedPerform(UiObject object) throws UiObjectNotFoundException {
                object.clearTextField();
            }
        };
    }

    void perform(UiObject object) {
        try {
            wrappedPerform(object);
        } catch (UiObjectNotFoundException e) {
            throw new RuntimeException(e);
        }
    }

    abstract void wrappedPerform(UiObject object) throws UiObjectNotFoundException;
}

@@ -1602,24 +1602,708 @@
   %7D;%0A    %7D%0A%0A
+    /**%0A     * Performs the swipe right action on the UiObject. The swipe gesture can be performed over any surface.%0A     * The targeted UI element does not need to be scrollable.%0A     *%0A     * @param steps indicates the number of injected move steps into the system. Steps are injected about 5ms apart.%0A     *              So a 100 steps may take about 1/2 second to complete.%0A     * @return%0A     */%0A    public static AutomatorAction swipeRight(final int steps) %7B%0A        return new AutomatorAction() %7B%0A            @Override%0A            void wrappedPerform(UiObject object) throws UiObjectNotFoundException %7B%0A                object.swipeRight(steps);%0A            %7D%0A        %7D;%0A    %7D%0A%0A
     void per

Add swipeRight action