stash away stuff
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
package org.sufficientlysecure.keychain.actions;
|
||||
|
||||
|
||||
import android.support.test.espresso.UiController;
|
||||
import android.support.test.espresso.ViewAction;
|
||||
import android.support.test.espresso.matcher.ViewMatchers;
|
||||
import android.support.v4.view.GravityCompat;
|
||||
import android.support.v4.widget.DrawerLayout;
|
||||
import android.view.View;
|
||||
|
||||
import org.hamcrest.Matcher;
|
||||
|
||||
|
||||
public abstract class CustomActions {
|
||||
|
||||
public static ViewAction actionOpenDrawer() {
|
||||
return new ViewAction() {
|
||||
@Override
|
||||
public Matcher<View> getConstraints() {
|
||||
return ViewMatchers.isAssignableFrom(DrawerLayout.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "open drawer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform(UiController uiController, View view) {
|
||||
((DrawerLayout) view).openDrawer(GravityCompat.START);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static ViewAction actionCloseDrawer() {
|
||||
return new ViewAction() {
|
||||
@Override
|
||||
public Matcher<View> getConstraints() {
|
||||
return ViewMatchers.isAssignableFrom(DrawerLayout.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "close drawer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void perform(UiController uiController, View view) {
|
||||
((DrawerLayout) view).closeDrawer(GravityCompat.START);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user